How to join to a column contains trailing spaces

I am trying to do a Left Outer Join between the above 2 tables.
select a.name, a.address, a.city, a.state, a.zip, nvl(b.zip_id,0) as zip_id
from t1 a, t2 b
where a.zip = b.zip(+)
The problem is that t2.zip is of 9 character size values with 5 digit zip code and 4 trailing spaces where as t1.zip is just 5 characters. Could any one advice me
on how to make this Join?
Thanks in advance.

Thanks for all your replies. The query work fine if it is an inner join. But when I try it as a left outer join it says missing expression.
select a.zip, b.zip, trim(zip_id) as zip_id
from t1 a, t2 b
where a.zip = substr(b.zip, 1, 5)(+)
create table t1 (zip varchar2(9));
insert into t1 values('17602');
insert into t1 values('20879');
insert into t1 values('21048');
insert into t1 values('21074');
insert into t1 values('21157');
insert into t1 values('21158');
insert into t1 values('21227');
insert into t1 values('21228');
insert into t1 values('21776');
insert into t1 values('21787');
insert into t1 values('21791');
insert into t1 values('21797');
create table t2 (zip varchar2(9), zip_id varhcar2(9));
insert into t2 values('21048 ','8813');
insert into t2 values('21074 ','8827');
insert into t2 values('17602 ','7193');
insert into t2 values('21150 ','8864');
insert into t2 values('21152 ','8865');
insert into t2 values('21153 ','8866');
insert into t2 values('21154 ','8867');
insert into t2 values('21155 ','8868');
insert into t2 values('21156 ','8869');
insert into t2 values('21157 ','8870');
insert into t2 values('21158 ','8871');

Similar Messages

  • Column contains only space(s)

    I have a problem using bind variables with Method 4 out of Pro*C/C++ Precompiler Programmer's Guide Release 8.1.5.
    I've pretty much taken the sample code and customized it. Everything else works fine; however, when I want to select where colum = :s and I have ' ', that's a single space, for a bind value, it doesn't find the row. This also occurs when there is more than one space. It works when I have 'A', or 'A ', or ' A', but not ' ' or ' '.
    Has anyone else seen this? can explain it? most importantly, found a way around it?

    How have you declared your bind variables? I assume the column type is CHAR?

  • Trailing spaces problem with OracleDataAdapter

    Hi,
    I have a char(60) column in the database which i cant change to nvarchar. I am using a ref cursor with the ODP.NET dataadapter to populate the dataset. The dataset has defined this column as a string. When I fill the dataset, the data for this column contains trailing spaces (to make it 60 characters).
    Situation: Stored Procedure returns a ref cursor that is used to fill the dataset using a dataadapter
    Problem: Trailing spaces in all char columns
    Attempts:
    1) Returning Trim(column_name) from the SP. This time the dataset column gets null values. Doesn't the trim work with the dataadapter.
    2) Tried returning length(trim(column_name)) from the SP. The dataset got all 0 values
    3) Tried returning length(column_name) from the SP. Returns 60 because the column is char(60)
    Any idea what is going on? Is this a bug? Is there a solution ?
    Thanks
    Nishith

    Got it !!! :D
    My query in the SP was SELECT TRIM(column_name) ... so it was trying to populate it into the "TRIM(column_name)" column of the dataset which is not there ... no have changed it to SELECT TRIM(column_name) as column_name ... works :)
    But is there an easier way ?
    Nishith

  • XI 3.0: Preserve trailer spaces with JMS Adapter

    Hi everybody
    Does anybody knows how it is possible to preserve the trailing spaces in a message coming from JMS adapter?
    I have a fixed-length field that is filled with a left space trailer, but the space is removed by (i think) the adapter.
    Does exists something similar to "whitespace=preserve" for the datatypes???
    Thanks in advance.

    If somebody is interested, just add the
    xml.<structname>.fieldContentFormatting = nothing to the module configuration params.
    I derived this one from the configuration guide of the File Adapter

  • How can i open a PDF bank statement in numbers so that the rows and columns contain properly aligned data from statement?

    how can i open a PDF bank statement in "numbers" so that the rows and columns contain properly aligned data from statement?

    Numbers can store pdfs pages or clippings but does not directly open pdf files.  To get the bank statement into Numbers as a table I would open the bank statment in Preview (or Skim) or some pdf viewer.
    Then hold the option key while selecting a column of data.
    Then copy
    Then switch to numbers and paste the column into a table
    Then repeat for the other columns in the pdf document
    It would be easier (in my opinion) to download the QFX or CSV version from your bank

  • How to identify the trailing spaces in a column

    Hi,
    How to identify the trailing spaces in a column.
    for ex: empno char(5) and i enter 333 then there will be 2 spaces remaining. How to identify that two spaces

    One method...
    ME_XE?create table test1 (some_char char(5));
    Table created.
    Elapsed: 00:00:00.11
    ME_XE?
    ME_XE?insert into test1 values ('HI');
    1 row created.
    Elapsed: 00:00:00.07
    ME_XE?insert into test1 values ('HI HO');
    1 row created.
    Elapsed: 00:00:00.07
    ME_XE?select * from test1 where trim(some_char) <> some_char;
    SOME_CHAR
    HI
    1 row selected.
    Elapsed: 00:00:00.14
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to select rows whose one column contains some specific characters ?

    These is a table say T1 with a column say C1
    Let the field C1's values be:
    row 1)DE/SPT/A/FWD
    row 2)G/SPT/DE/DE/SPT
    row 3)R/FWD/SPT/A/FWD/FWD
    row 4)A/A/DE/SPT/FWD
    row 5)FWD/SPT/E/DE/A
    How to get only those rows whose C1 column contains FWD in last ?

    We can solve this with the simple use of a wildcard:
        select *
        from t1
        where c1 like '%FWD'
        /Note that this query will execute a full table scan, because any index you may have on C1 will be ignored: indexes are organised on the leading characters.
    cheers, APC

  • How to get rows where a varchar column contain pure numeric value

    hi,
    i have to make a query from a table that return only the rows where the occurrences of a string column contain a pure numeric value
    for example my table MYTABLE have the column COL1 varchar2(100)
    with values
    row 1 : '100'
    row 2 : '101 dalmatiens'
    row 3 : '102'
    row 4 : 'anything'
    i want to get only the rows 1 and 3 which are pure integer so i can sort and compare them like number.
    thanks

    SQL> with rt as   
      2  (select '100' str from dual union all 
      3  select '101 dalmatiens' from dual union all 
      4  select '102' from dual union all
      5  select '103 #$&''() 456' from dual union all
      6  select 'anything' from dual)
      7  /* End of sample data (rt) */
      8  select str
      9         ,trim(translate(str,'1234567890'||str,'1234567890')) num
    10  from rt
    11  where trim(translate(str,'1234567890'||str,'1234567890')) is not null;
    STR            NUM
    100            100
    101 dalmatiens 101
    102            102
    103 #$&'() 456 103456
    -- Oooooops, I misread and now have corrected it
    SQL> with rt as   
      2  (select '100' str from dual union all 
      3  select '101 dalmatiens' from dual union all 
      4  select '102' from dual union all
      5  select '103 #$&''() 456' from dual union all
      6  select 'anything' from dual)
      7  /* End of sample data (rt) */
      8  select str
      9         ,trim(translate(str,'1234567890'||str,'1234567890')) num
    10  from rt
    11  where trim(translate(str,'1234567890'||str,'1234567890')) = str;
    STR            NUM
    100            100
    102            102Message was edited by:
    ushitaki

  • Foreign Key join between two columns in a dimension to one column in Fact

    Hi,
    I have a requirement to join two columns in a Dimension to the same column in the fact.
    My reports contains columns from this dimension and will need to use both the joins to get the correct values. So I am not sure if I create an alias to join the second column, if that will be output incorrect values.
    How can we achieve this so that I can still use columns from the dimension and still run both the joins in my SQL eventually.
    Dimension
    Column 1
    Column2
    Fact
    Column 3
    Need to map Column1--->Column 3 and Column2 -----> Column 3
    Thanks

    I put it in Dimension and dimension extension scenario with a fact
    The possible scenarios are:
    1) Column1--->Column 3 and Column2 -----> Column 3
    Both Column1 and Column2 have their own logical tables in BMM
    2)
    Column1--->Column 3
    Column1--->Column2
    In this case You have Logical table with 2 different sources Column1 and Column2 using column mapping.
    you can go for multiple logical sources in this case, based on column selection tables in the join condition

  • How to join two tables

    hi
    how to join two tables using inner join  if the first table has two primary keys and second table has 3 primary keys

    Would describe type of joins in ABAP, which might differ with other joins.
    The join syntax represents a recursively nestable join expression. A join expression consists of a left-hand and a right- hand side, which are joined either by means of INNER JOIN or LEFT OUTER JOIN. Depending on the type of join, a join expression can be either an inner (INNER) or an outer (LEFT OUTER) join. Every join expression can be enclosed in round brackets. If a join expression is used, the SELECT command circumvents SAP buffering.
    On the left-hand side, either a single database table, a view dbtab_left, or a join expression join can be specified. On the right-hand side, a single database table or a view dbtab_right as well as join conditions join_cond can be specified after ON. In this way, a maximum of 24 join expressions that join 25 database tables or views with each other can be specified after FROM.
    AS can be used to specify an alternative table name tabalias for each of the specified database table names or for every view. A database table or a view can occur multiple times within a join expression and, in this case, have various alternative names.
    The syntax of the join conditions join_cond is the same as that of the sql_cond conditions after the addition WHERE, with the following differences:
    At least one comparison must be specified after ON.
    Individual comparisons may be joined using AND only.
    All comparisons must contain a column in the database table or the view dbtab_right on the right-hand side as an operand.
    The following additions not be used: NOT, LIKE, IN.
    No sub-queries may be used.
    For outer joins, only equality comparisons (=, EQ) are possible.
    If an outer join occurs after FROM, the join condition of every join expression must contain at least one comparison between columns on the left-hand and the right-hand side.
    In outer joins, all comparisons that contain columns as operands in the database table or the view dbtab_right on the right-hand side must be specified in the corresponding join condition. In the WHERE condition of the same SELECT command, these columns are not allowed as operands.
    Resulting set for inner join
    The inner join joins the columns of every selected line on the left- hand side with the columns of all lines on the right-hand side that jointly fulfil the join_cond condition. A line in the resulting set is created for every such line on the right-hand side. The content of the column on the left-hand side may be duplicated in this case. If none of the lines on the right-hand side fulfils the join_cond condition, no line is created in the resulting set.
    Resulting set for outer join
    The outer join basically creates the same resulting set as the inner join, with the difference that at least one line is created in the resulting set for every selected line on the left-hand side, even if no line on the right-hand side fulfils the join_cond condition. The columns on the right-hand side that do not fulfil the join_cond condition are filled with null values.
    Note
    If the same column name occurs in several database tables in a join expression, they have to be identified in all remaining additions of the SELECT statement by using the column selector ~.
    Example
    Join the columns carrname, connid, fldate of the database tables scarr, spfli and sflight by means of two inner joins. A list is created of the flights from p_cityfr to p_cityto. Alternative names are used for every table.
    PARAMETERS: p_cityfr TYPE spfli-cityfrom,
    p_cityto TYPE spfli-cityto.
    DATA: BEGIN OF wa,
    fldate TYPE sflight-fldate,
    carrname TYPE scarr-carrname,
    connid TYPE spfli-connid,
    END OF wa.
    DATA itab LIKE SORTED TABLE OF wa
    WITH UNIQUE KEY fldate carrname connid.
    SELECT ccarrname pconnid f~fldate
    INTO CORRESPONDING FIELDS OF TABLE itab
    FROM ( ( scarr AS c
    INNER JOIN spfli AS p ON pcarrid = ccarrid
    AND p~cityfrom = p_cityfr
    AND p~cityto = p_cityto )
    INNER JOIN sflight AS f ON fcarrid = pcarrid
    AND fconnid = pconnid ).
    LOOP AT itab INTO wa.
    WRITE: / wa-fldate, wa-carrname, wa-connid.
    ENDLOOP.
    Example
    Join the columns carrid, carrname and connid of the database tables scarr and spfli using an outer join. The column connid is set to the null value for all flights that do not fly from p_cityfr. This null value is then converted to the appropriate initial value when it is transferred to the assigned data object. The LOOP returns all airlines that do not fly from p_cityfr.
    PARAMETERS p_cityfr TYPE spfli-cityfrom.
    DATA: BEGIN OF wa,
    carrid TYPE scarr-carrid,
    carrname TYPE scarr-carrname,
    connid TYPE spfli-connid,
    END OF wa,
    itab LIKE SORTED TABLE OF wa
    WITH NON-UNIQUE KEY carrid.
    SELECT scarrid scarrname p~connid
    INTO CORRESPONDING FIELDS OF TABLE itab
    FROM scarr AS s
    LEFT OUTER JOIN spfli AS p ON scarrid = pcarrid
    AND p~cityfrom = p_cityfr.
    LOOP AT itab INTO wa.
    IF wa-connid = '0000'.
    WRITE: / wa-carrid, wa-carrname.
    ENDIF.
    ENDLOOP.

  • How to join two pl/sql tables .,.,,Urgent pls help

    Hi,
    Please tell me how to join to pl/sql tables with example
    thanks
    asp

    If your main intention is to get the common records/or getting whole records from the 2 different pl/sql arrays then , pls check this piece of code & explanation
    The SQL language has long offered the ability to apply set operations (UNION, INTERSECT, and MINUS) to the result sets of queries. In Oracle Database 10g, you can now use those same high-level, very powerful operators against nested tables (and only nested tables) in your PL/SQL programs and on nested tables declared as columns inside relational tables.
    Let's take a look at some of the syntax needed to do this, starting with UNION.
    First, I create a schema-level nested table type:
    CREATE OR REPLACE TYPE strings_nt
    IS TABLE OF VARCHAR2(100);
    Then I define a package and within it create and populate two nested tables of this type, each containing some of my father's and my favorite things:
    CREATE OR REPLACE PACKAGE favorites_pkg
    IS
    my_favorites strings_nt
    := strings_nt ('CHOCOLATE'
    , 'BRUSSEL SPROUTS'
    , 'SPIDER ROLL'
    dad_favorites strings_nt
    := strings_nt ('PICKLED HERRING
    , 'POTATOES'
    , 'PASTRAMI'
    , 'CHOCOLATE'
    PROCEDURE show_favorites (
    title_in IN VARCHAR2
    , favs_in IN strings_nt
    END;
    In this package, I also include a procedure to show the contents of a strings_nt nested table. This will come in very handy shortly.
    By defining these collections in a package, outside any program, they persist (they maintain their state and values) for the duration of my session or until I change or delete them. This means that I can now write programs outside the package to manipulate the contents of those collections.
    Note that this package has been simplified for the purposes of presenting collection functionality. In a production application, you should always take care to "hide" your package data, as with these collections, in the package body, and then provide procedures and functions to manage the data.
    Suppose, for example, that I would like to combine these two collections into a single collection of our favorites. Prior to Oracle Database 10g, I would have to write a loop that transfers the contents of one collection to another. Now, I can rely on the MULTISET UNION operator, as shown below:
    DECLARE
    our_favorites
    strings_nt := strings_nt ();
    BEGIN
    our_favorites :=
    favorites_pkg.my_favorites
    MULTISET UNION ---- Use INTERSECT , if you want to know common records
    favorites_pkg.dad_favorites;
    favorites_pkg.show_favorites (
    'ME then DAD', our_favorites);
    END;
    The output from this script is:
    ME then DAD
    1 = CHOCOLATE
    2 = BRUSSEL SPROUTS
    3 = SPIDER ROLL
    4 = PICKLED HERRING
    5 = POTATOES
    6 = PASTRAMI
    7 = CHOCOLATE
    ------------------------------

  • How to perform calculations using column data in BI Publisher

    Hello guys
    I am very new to BIP, and recently I am learning to create new templates using XML files..
    I am trying to create a report that has Account Amount, Amount Net Amount, PM_Amount and a New field say "X"
    For Account Amount it is what it is, but for Net Amount it is "Account Amount/40%", for PM_Amount it is "Net Amount x (Account Amount/30)" and for field X it is "(Net Amount + PM_Amount)/column A" where column A is another data field in the XML file but it should not be included in the template report..
    Could anyone help me with how to perform such kind of calculations in BIP Template builder? In OBIEE, it is very easy that I can just use column formula, but in BIP I still haven't figure out the way yet..
    PLease advice
    Thanks

    Thanks for the reply..
    I looked at the link you provided already, what I wanna know is how to exactly apply the expression in my calculation. In other words, I know that Column C = "Column A div Column B", but in BIP form property, how do I actually substitue "column A" with the actual column..
    I wish I could post the XML, but it is huge, it contains 6 data sets and more than 100 columns. I only need 15 columns on my template.
    On the form property of each measures, in the "advance tab", I see codes like <?accountamount?>. Now I wanna have a new column said "PM_Amt" which should be "(accountamount div %40) x column B". So I just randomly select another column said "payment". I rename it to "PM_AMT" and on its "advanced tab" it is still <?payment?>. So right there, if I wanna replace that code with a new one that does "(accountamount div %40) x column B" calculation, how would I do it? What would be the syntax including how to propertly refer to the right column field as part of the expression?
    And do I have to always use xdofx between <>? how would I know?
    Please advice if you understood what I am trying to say
    Much thanks
    Edited by: user7276913 on Sep 14, 2009 11:24 PM

  • How to wrap text for column level field

    Hi,
    In iSourcing module. I have requirement for RFQ response page. I have to wrapt text of table level column.
    Screen have total 6 columns. First column heading is Line. This column displays item description. Length of Item description in VO is 240 characters.
    Presently entire 240 characters are displayed in one line only. Because of this user has to scroll towards the right to see remaining columns.
    Requirement is to wrap this first column contents so that all columns will get visible without scrolling.
    How do I set this wrap functionality on this column through Controller?
    I tried by following ways, but no luck,
    1. In processRequest method
    OAFlowLayoutBean ls_line = (OAFlowLayoutBean)oatablebean.findChildRecursive("Line");
    if(ls_line != null)
    ls_line.setWrapEnabled(true);
    In personalize options of “Line” field there is no option for “No Wrap” property.
    How can I achieve this column wrap functionality?
    Kindly help,
    Thanks in advance.
    Mandar

    Hi Ajay,
    This Flow Layout contains following items,
    1. DocLineNumber(messageStyleText)
    2. ItemDescription(messageStyleText)
    Requirement is to wrap ItemDescription.
    So i tried following code, but still no luck,
    OATableBean oatablebean = (OATableBean)oawebbean.findChildRecursive("BidItemPricesTableVO");
    OAMessageStyledTextBean ls_item_description = (OAMessageStyledTextBean)oatablebean.findChildRecursive("ItemDescription");
    if(ls_item_description != null)
    ls_item_description.setWrapEnabled(true);
    XML file name: ponResponsePG.xml
    File Location: $APPL_TOP/pon/12.0.0/mds/response/creation/webui/ponResponsePG.xml
    I am not able to post ponResponsePG.xml file here(Your message exceeds the maximum length of 30000 characters.
    ), can i have your email id? i will email this file to.
    Thanks and Regards,
    Mandar

  • How to Copy a Long Column in PL/SQL

    Hello. Can anyone tell me how to copy a table that contains a long column? I am using Oracle 8.0.5 SQL Worksheet
    with the following code that generates an ORA-06502: PL/SQL: numeric or value error.
    CREATE TABLE "Tmp_CB_REPORT"
         CB_RPT_ID NUMBER(38, 0),
         CB_ID NUMBER(38, 0),
         CB_REGION_ID NUMBER(38, 0),
         WHEN_PULLED DATE NOT NULL,
         PARSED NUMBER(1, 0) DEFAULT (0) NOT NULL,
         RAW_DATA LONG NOT NULL,
         JOINT NUMBER(1, 0) DEFAULT (0) NOT NULL,
         RPTTYPE NUMBER(38, 0) NOT NULL,
         OPTION1 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION2 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION3 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION4 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION5 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION6 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION7 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION8 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION9 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION10 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION11 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION12 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION13 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION14 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION15 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION16 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION17 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION18 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION19 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         OPTION20 NUMBER(1, 0) DEFAULT (0) NOT NULL,
         REGION_ID NUMBER(38, 0),
         RPT_TYPE_DESC VARCHAR2(40)
    LOCK TABLE CB_REPORT IN EXCLUSIVE MODE NOWAIT;
    DECLARE
         CURSOR datacursor IS SELECT CB_RPT_ID, CB_ID, CB_REGION_ID, WHEN_PULLED, PARSED, RAW_DATA, JOINT, RPTTYPE, OPTION1, OPTION2, OPTION3, OPTION4, OPTION5, OPTION6, OPTION7, OPTION8, OPTION9, OPTION10, OPTION11, OPTION12, OPTION13, OPTION14, OPTION15, OPTION16, OPTION17, OPTION18, OPTION19, OPTION20, REGION_ID, RPT_TYPE_DESC FROM CB_REPORT;
         datarecord datacursor%ROWTYPE;
    BEGIN
         OPEN datacursor;
         LOOP
              FETCH datacursor INTO datarecord;
              EXIT WHEN (datacursor%NOTFOUND);
              INSERT INTO "Tmp_CB_REPORT"(CB_RPT_ID, CB_ID, CB_REGION_ID, WHEN_PULLED, PARSED, RAW_DATA, JOINT, RPTTYPE, OPTION1, OPTION2, OPTION3, OPTION4, OPTION5, OPTION6, OPTION7, OPTION8, OPTION9, OPTION10, OPTION11, OPTION12, OPTION13, OPTION14, OPTION15, OPTION16, OPTION17, OPTION18, OPTION19, OPTION20, REGION_ID, RPT_TYPE_DESC) VALUES (datarecord.CB_RPT_ID, datarecord.CB_ID, datarecord.CB_REGION_ID, datarecord.WHEN_PULLED, datarecord.PARSED, datarecord.RAW_DATA, datarecord.JOINT, datarecord.RPTTYPE, datarecord.OPTION1, datarecord.OPTION2, datarecord.OPTION3, datarecord.OPTION4, datarecord.OPTION5, datarecord.OPTION6, datarecord.OPTION7, datarecord.OPTION8, datarecord.OPTION9, datarecord.OPTION10, datarecord.OPTION11, datarecord.OPTION12, datarecord.OPTION13, datarecord.OPTION14, datarecord.OPTION15, datarecord.OPTION16, datarecord.OPTION17, datarecord.OPTION18, datarecord.OPTION19, datarecord.OPTION20, datarecord.REGION_ID, datarecord.RPT_TYPE_DESC);
         END LOOP;
    END;
    The copy works fine if I remove the long column from the CREATE TABLE "Tmp_CB_REPORT" statement
    and the cursor copy statement. Any help is appreciated.

    What I think you should do is to turn your long into a LOB. LOBs are much malleable than LONGs. I suggest you have a look at the documentation for DBMS_LOB. You can create a function using DBMS_LOB that uses a temporary CLOB to reas your long column an dreturn a CLOB.
    Cheers, APC

  • How can I read a column of numbers saved as .txt and display as a wave?

    Hi Tiano
    LabVIEW General
    Ask:
    Please enter a one-line summary of your question
    Resources
    • Technical Support
    • Development Library
    • Measurement Encyclopedia
    "data/time reading into chart"
    "In the attached file, I am trying to read the first column of data, and the next column is the value on the x-axis I want it plotted at. How do I read two columns of different data? I have looked in the books I have access to and the help within Labview but am still having trouble.
    Thank you,
    Ellie"
    data_set (Plain Text, 3K)
    -posted by Ellie on 9/11/2001
    markwysong on 9/11/2001 answered:
    "Ellie,
    The first thing you need to do is to read your file in as a spreadsheet file. Then, you display it in a chart.
    That sounds simple, but looking at your dataset, there's a few things you should know. First, the "read from spreadsheet VI" is looking for data in columns, like your data set, but columns separated by tabs. Therefore, your data must be saved that way; currently, it doesn't seem that it is. Another thing; you must skip the header portion (labels) of your file when reading.
    Next, it would be easier if your time was first, and your data was second in your columns, but that can be overcome. In the VI I am including, I have copied your data set into a file called data.txt, and I've removed the header and separated the columns with a tab. Then, I read in the data, and I break out each column so I can put the time first, and then I combine them again into a cluster so it can be displayed on an XY chart.
    Take a look!
    Mark"
    Graph data from file (Binary Executable, 20K)
    data.txt (Plain Text, 3K)
    This answer has not yet been rated.
    Rate this answer:
    Mikael Garcia on 9/11/2001 answered:
    "Ellie,
    Here is one way of doing it. Take a look at this example (compatible with LabVIEW 4.1 and up) and post comments if you need further help. Basically, I read your file as text; split it; and make use of the Spread sheet string to Array function before I plot your data. Hope this helps./ Mikael"
    ExtractAndPlot.vi (Binary Executable, 36K)
    This answer has not yet been rated.
    Rate this answer:
    Ellie on 9/12/2001 commented:
    "Thank you. I am trying to get the data from the text file into a string and am having some trouble. I am reading the file from a spreadsheet, and sending the output array to "Array to Spreadsheet String", but I'm not sure this is what I want to do. Is there another way to make an array into a string? Do I need to reformat my data?
    Can you offer me any advice?
    Thank you."
    data_1 (Plain Text, 3K)
    Mikael Garcia on 9/12/2001 commented:
    "I noticed that you changed your file format according to what was said here. Yes, this new file of yours is easier to use but your original file does not have to be changed. Take a look at this example. I now added the file-read part. It will give you a dialog to locate your data file (use this VI with your original file with the header since this VI includes a string split function). Hope this helps. /Mikael"
    ReadExtractandPlot.vi (Binary Executable, 35K)
    Niko on 9/12/2001 answered:
    "If you read this file with the "read from spreadsheet file.vi" you get you
    data in a 2-D-array. Now it is easy with array- and cluster-functions to
    handle the data the way you want.
    hope that helps, Niko"
    This answer has not yet been rated.
    Rate this answer:
    I intend to read from a .txt file that contains a column of numbers. After reading I want to display it as a waveform. In fact the numbers represent points along a waveform/graph of Flow vs. time. Thus I want to have this info in the chart or graph with flow in the y0axis and time in the x-axis. Can someone give me some detailed help please? Thank you in advance.
    Attachments:
    The_file.txt ‏18 KB

    All you have to do is use Read From Spreadsheet File.vi that's on the File I/O palette. For your example .txt, set the Transpose input to true and wire the First Row output to a waveform graph. The only problem I see is that since your file doesn't contain any sampling info, the time axis will be relative. If have that information elsewhere, then you can put a build waveform function between the read and the graph. Wire the First Row output to the Y input Build Waveform and add t0 and dt values. I've attached an example.
    Attachments:
    Graph_from_text.vi ‏29 KB

Maybe you are looking for

  • HT201365 I reset my iPhone 4 and it says I need to log into my iCloud

    I reset my iPhone 4 and it says I need to log into my iCloud, but I don't have an iCloud even though it gives me the first letter to an email, of which I don't have. I bought my phone from Verizon when it was new. What do I do?

  • Question about screen protector (ipad2)

    Hi, I just applied a screen protector on my iPad 2 and I've noticed that it isn't 100% straight: The front camera doesn't sit exactly in the protector's hole. Actually, the hole in the protector kind of sits in the center of the camera. It doesn't di

  • Password recovery on CallManager server

    Hi, I have some CallManager server and I don't know admin password. I have one but it is not taht password. Can you tell me how can I do password recovery on CallManager server? Thanks, Vlaho

  • Nvidia Recently posted 81.95. Release notes states it fixed issues with

    which the 8.94 drivers had. Has anyone installed these and saw a compatibility differnece using the X-FI?

  • Zen Touch Pr

    i am about to buy another zen touch 40gb but i was wondering if there where any good sales on websites or stores in the usa that i might be able to find it for a good price, the cheapest i seen so far is 27 but it is out of stock. your help would be