Reading each row of a .csv file in 12.1

I have  a .csv file with the first row as header information and multiple data rows. I aim to insert the data rows into SQL database. The functionality works fine with MII 11.5, where I loaded the content using a text loader and used a flat file parser to retrieve each row. But 12.1 the flat file parser gives me a single row with all the header and value data separated by commas. How can I read each row of the *.csv to make my database insert possible? Please help!

@ Sam,
This should help me. thanks!
@ Christian Libich,
Checking the number of columns in the first row is also a part of the requirement. I may have to reject files that have incorrect number of columns. this restricts me from checking the string list output / expected column count. If I expect 10 columns in the first row and the string list gives me a total of 100 columns, I will not be able to decide if it is a csv with 10 columns and 10 rows (good file) or  20 columns with 5 rows (bad file)
@ Ajay,
Got to check this.
Thanks!

Similar Messages

  • Reading each value from spreadshee​t file with delay (multiple rows and columns)

    Hi,
    a) I want to read EACH VALUE from a spreadsheet file having multiple rows and columns WITH DELAY. I am attaching my VI and sample datalog file for reference (tempsensor.txt).I need to do so because as soon as I read put ON the Sensor button on front panel, LV reads all the values at one go. I need the values for each temperature to be displayed after a delay.
    b) Secondly, I would like to read another file containing the state of four antennas (deployed:1; undeployed:0). I am logging state of each antenna in each column of the file(magnet.txt) I need to have four LEDS on front panel to display state of the antennas. I dont know what I have done for antennas in my VI is right or wrong. I guess thats rhe wrong way to approach the problem. Please help!!!(column1: Antenna1 state ; Column2:Antenna2 state.. and so..on..)
    Any help would be greatly appreciated!!
    Thanks in advance,
    Ratnesh
    FYI: The first column in my datalog file represents timestamp(number of seconds elapsed), second column: reading for temperature sensor 1, third column: reading for temperature senosr 2, and so on. I am using approx. 11 temperature sensors.
    Also, I have generated the log files for the reference purpose only. They do not represent the actual values. They are far away from actual values.
    Attachments:
    01032005.zip ‏30 KB

    Look at this modified version of your VI. After looking at it, I determined that a shift reggister was not required in this case.
    Lynn
    Attachments:
    MultiSensors.2.vi ‏85 KB

  • Adding row into existing CSV file using C#

    How to add row to existing CSV file using .NET Code.the file should not be overwrite,it need add another row with data.how to implement this scenario.

    Hi BizQ,
    If you only just write some data to CSV file. Please follow A.Zaied and Magnus  's reply. In general,we use CSV file to import or export some data. Like following thread and a good article in codeproject
    Convert a CSV file to Excel using C#
    Writing a DataTable to a CSV file
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Reading Each String From a text File

    Hello everyone...,
    I've a doubt in File...cos am not aware of File.....Could anyone
    plz tell me how do i read each String from a text file and store those Strings in each File...For example if a file contains "Java Tchnology forums, File handling in Java"...
    The output should be like this... Each file should contains each String....i.e..., Java-File1,Technology-File2...and so on....Plz anyone help me

    The Java� Tutorials > Essential Classes: Basic I/O

  • Need to read each sheet of an excel file and pass it to XI

    Hi
    Actually i need to read each sheet of an excel file and pass it to XI and will create one xml file .I am able to read the excel file by writting a custom module and it is generating the xml output from XI.But my requierment is to read the excel file and create the xml with the sheet name of the excel.suppose sheet name is sheet1, the xml file name will be  sheet1.xml.if sheet name is sheet2 the xml file name will be  sheet2 and so on....how can i pass this parameter from NWDS to SAP XI s i am passing the string which contains the sheet data.

    If I understood correct you are already reading the XLS and creating the XML (not sure if this is a separate executing body out side of XI). Are you using any sort of Object Modal in Java to read the XML? I am aware of Visual Basic object modal for Excel but not sure if one is available in Java from Microsoft.
    The Object modal that you are using must be providing an iterator to loop through each of the sheet in the Excel workbook and you should be able to create the XMLs as you desired.
    I would be glad to look at you module if you are doing it once the XI file adapter has picked up the excel file.
    VJ

  • Reading and Sorting from a CSV file

    I have an assignment to read a shopping list from a CSV file, sort the items and print or write the items to a text file. I have an idea though. I intend to use vectors to collect the items from the CSV file and then sort the list and write to a txt file. Someone tell me whether this is a right approach or suggest simpler approach. thank you.
    Derry

    Sounds reasonable.
    Rather than Vector, though, I'd use ArrayList (a very near replacement for Vector) or possibly LinkedList or even Set or Map. (Vector is a legacy class, kept around for backward compatibility.)
    http://java.sun.com/docs/books/tutorial/collections/
    Make sure each element in the List corresponds to one row in the file. Those elements should be a class you define whose member variables correspond to the columns in the file. (So if the file has Last, First, Bday columns, your class would have lastName, firstName, and birthday fields.)
    Make your class Comparable, or implement a Comparator, to make sorting straightforward.
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Comparable.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/Comparator.html

  • File Adapter - Skipping first row (header row) in a csv file

    How can I skip processing the first row in BPEL? I have a csv file and the first row has column header that I should not process.
    Thanks

    Hi,
    Use nxsd:headerLines="1" in the declaration section see the sample below
    Name,Street,City,State,Country
    ABC Private Limited, Street 1, Bangalore, Karnataka, India
    XYZ Private Limited, Street 2, Bangalore, Karnataka, India
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
                targetNamespace="http://www.oracle.com/ias/processconnect"
                xmlns:tns="http://www.oracle.com/ias/processconnect"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified"
                nxsd:encoding="US-ASCII"
                *nxsd:headerLines="1"*            nxsd:stream="chars"
                nxsd:version="NXSD">  <xsd:element name="AddressBook">
        <xsd:complexType>
          <xsd:sequence>
           <xsd:element name="Address" minOccurs="1" maxOccurs="unbounded">
             <xsd:complexType>
               <xsd:sequence>
                 <xsd:element name="Name" type="xsd:string" nxsd:style="terminated"
                    nxsd:terminatedBy="," >
                  </xsd:element>
                 <xsd:element name="Street" type="xsd:string" nxsd:style="terminated"
                    nxsd:terminatedBy="," >
                 </xsd:element>
                 <xsd:element name="City" type="xsd:string" nxsd:style="terminated"
                    nxsd:terminatedBy="," >
                 </xsd:element>
                 <xsd:element name="State" type="xsd:string" nxsd:style="terminated"
                    nxsd:terminatedBy="," >             </xsd:element>
                 <xsd:element name="Country" type="xsd:string" nxsd:style="terminated"
                    nxsd:terminatedBy="${eol}" >
                 </xsd:element>
               </xsd:sequence>
             </xsd:complexType>
           </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>

  • VBScript to read the content of a .csv file and delete old files mentioned in the .csv

    I have a Windows 2003 file server.
    I have generated a report in .csv format, about the files which are older than 1 year.
    I need a VBScript to read the .csv file and delete the files which are enlisted there.
    Can someone please help me with this?

    Look into the "Learn" link above.  There are resources and instructions on how to write VBScript code.  Look into how to use the FileSystemObject.
    ¯\_(ツ)_/¯

  • How to read image present in a csv file ---- required urgently

    Hi,
    I have a task. where i will be given a csv file which consists of text and images. Reading text is ok but how can i read images present in the csv.
    Does anybody have any suggestions.
    Regards,
    Nag.

    what format are the images in?
    do you know the size of the image?
    How will you know if a character that shows up as ',' is really part of the image or not?
    If you know the size, it can be done, just treat the whole file as a 'binary' file and go at it from that perspective.
    if you have control over the format, it would be better to only store the name of the image in the csv file and just have the full path name in the portion that is in the csv file. then the actual file can hold the binary format specific data.
    if you don't, then you need to know the size of the image before you start loading the image into a memory buffer. you will also need some sort of 'delimiter' or keyword that says an image is coming next
    ie:
    %%image_block_follows%%,5016,asdfasd399c9e939d9c9
    where 5016 would be the number of bytes following the next comma. imbedded commas would not be treated as separators until you get to byte relative + 5017, and the bytes described above would probably look a bit more unreadable.

  • How to convert a row value in CSV file to column value

    Hi
    We have one requirement where we have to show the row value to column level value
    for Example:
    Source file will be in below format
    Component Name :101
    **Batch #     **100% Mod     200% Mod      300% Mod      400% Mod     Tensile     Elongation     Thickness*
    8584-17     498     1211     1986     2601     3133 523     0.088
    Output Format has to be:
    **Batch #     **100% Mod     200% Mod      300% Mod      400% Mod     Tensile     Elongation     Thickness Component name*
    8584-17     498     1211     1986     2601     3133 523     0.088 101
    How can we achieve this using shell/Perl script

    .

  • To read the csv file using collections

    i am able to retrieve each row of the csv file which is in table format But in some columns the data entered is in two or three lines while retriving the row, the program is taking The second line of that column as the second row of that file
    how could i display the entire row of that file in a single line.
    i have done this program could u please help out in this program
    package fileReading;
         import java.io.BufferedReader;
         import java.io.FileReader;
         import java.util.*;
         import java.util.Vector;
    public class FileReading
         public static void main(String args[]){
         try{
         String line;
         int startInd,endInd;
         char FieldSeparator = ',';
    //       List recordset;
         Map recordset;
         Vector record;
         int recordNumber=0;
    //       recordset = new ArrayList();
         recordset = new HashMap();
         BufferedReader in = new BufferedReader(new FileReader("c:\\GEMSBBtest.csv"));
         line = in.readLine();
         line = in.readLine();
         do{
         int len = line.length();
         record = new Vector();
    //       System.out.println(line);
         for(startInd = -1, endInd = 0; endInd >=0; ){
         endInd = line.indexOf(FieldSeparator,startInd+1 );
         if (endInd < 1){
         record.add(line.substring(startInd+1,len));
    //       System.out.println(line.substring(startInd+1,len));
         else{
         record.add(line.substring(startInd+1,endInd));
    //       System.out.println(line.substring(startInd+1,endInd));
         startInd = endInd;
         recordNumber++;
    //       recordset.add(record);
         recordset.put(Integer.toString(recordNumber),record);
         line = in.readLine();
    if (recordNumber<3)
         System.out.println(line);
         }while(line!=null);
         System.out.println(recordset.size());
         //System.out.println(recordNumber);
         }catch(Exception e){
         System.out.println(e.toString());
         }

    No there is no such special characters.Actually the file which there in xls format is being converted to csv format
    Now in each cell there r multiple lines and i need to print each row in a single line including that multiple line column or cell

  • CSV FILE TO DATABASE

    hi,
    m neame coloumns awsto java. i have a requirement.i hav a csv file .i have database table which has same coloumns as the csv field names.
    i have to upload the contents of the csv file in to the table.
    at present i am being able to read each line in da csv file using the readLine method and storing into array.
    i have to now insert this row into the database using prepared statement.
    but how do i set the values into the preared statement.
    i am retrieving each row from the csv.
    can anyone help me

    Try http://www.aquafold.com/ Aqua Data.
    It loads data from formats such as CSV and loads them
    into an existing table.
    Plus many other cool features.Peter, thanks for that link. Looks neat.
    To the OP:
    You have at least two options:
    1. Use Java to load the data through a series of INSERT statements.
    2. Use the bulk loader facilities found in many of todays RDBMS.
    Now go do your homework.

  • Data formatting and reading a CSV file without using Sqlloader

    I am reading a csv file to an Oracle table called sps_dataload. The table is structured based on the record type of the data at the beginning of
    each record in the csv file. But the first two lines of the file are not going to be loaded to the table due to the format.
    Question # 1:
    How can I skip reading the first two lines from my csv file?
    Question # 2:
    There are more fields in the csv file than there are number of columns in my table. I know I can add filler as an option, but then there are
    about 150 odd fields which are comma-separated in the file and my table has 8 columns to load from the file. So, do I really have to use filler
    for 140 times in my script or, there is a better way to do this?
    Question # 3:
    This is more of an extension of my question above. The csv file has fields with block quotes - I know this could be achieved in sql loader when we mention Occassionally enclosed by '"'.
    But can this be doable in the insert as created in the below code?
    I am trying to find the "wrap code" button in my post, but do not see it.
    Heres my file layout -
    PROSPACE SCHEMATIC FILE
    ; Version 2007.7.1
    Project,abc xyz Project,,1,,7,1.5,1.5,1,1,0,,0,1,0,0,0,0,3,1,1,0,1,0,0,0,0,2,3,1,0,1,0,0,0,0,3,3,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    Subproject,25580-1005303.pst,,102,192,42,12632256,1,1,102,192,42,1,12632256,0,6,1,0,32896,1,0,0,0,0,,,-1,-1,-1,-1,0,0,0,-1,-1,-1,-1,-1,-1,0,0,0,-1,-1,-1,-1,-1,-1,0,0,0,-1,-1,0,1,1,,,,,,1
    Segment, , , 0, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, , , , , , , , , , , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, , , 1
    Product,00093097000459,26007,2X4 MF SF SD SOLR,,28.25,9.5,52.3, 8421504,,0,,xyz INC.,SOLAR,,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,1,000000.60,0,0,0,0,00,-1,0
    Product,00093097000329,75556,"22""X22"" BZ CM DD 1548",,27,7,27, 8421504,,0,,xyz INC.,SOLAR,,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,1,000000.20,0,0,0,0,0,0,0,,345.32
    Product,00093097000336,75557,"22""X46"" BZ CM XD 48133",,27,7.5,51, 8421504,,0,,xyz INC.,SOLAR,,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,1,000000.20,0,0,0,0,0,0,0,0
    Product,00093097134833,75621,"22""X22"" BZ CM/YT DD 12828",,27,9,27, 8421504,,0,,xyz INC.,SOLAR,,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,1,000000.20,0,0,0,0,0,0,0,,1
    This is my table structure -
    desc sps_dataload;
    File_Name     Varchar2 (50) Not Null,
    Record_Layer Varchar2 (20) Not Null,     
    Level_Id     Varchar2 (20),
    Desc1          Varchar2 (50),
    Desc2          Varchar2 (50),
    Desc3          Varchar2 (50),
    Desc4          Varchar2 (50)
    Heres my code to do this -
    create or replace procedure insert_spsdataloader(p_filepath IN varchar2,
    p_filename IN varchar2,
    p_Totalinserted IN OUT number) as
    v_filename varchar2(30) := p_filename;
    v_filehandle UTL_FILE.FILE_TYPE;
    v_startPos number; --starting position of a field
    v_Pos number; --position of string
    v_lenstring number; --length of string
    v_record_layer varchar2(20);
    v_level_id varchar2(20) := 0;
    v_desc1 varchar2(50);
    v_desc2 varchar2(50);
    v_desc3 varchar2(50);
    v_desc4 varchar2(50);
    v_input_buffer varchar2(1200);
    v_delChar varchar2(1) := ','
    v_str varchar2(255);
    BEGIN
    v_Filehandle :=utl_file.fopen(p_filepath, p_filename, 'r');
    p_Totalinserted := 0;
    LOOP
    BEGIN
    UTL_FILE.GET_LINE(v_filehandle,v_input_buffer);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXIT;
    END;
    -- this will read the 1st field from the file --
    v_Pos := instr(v_input_buffer,v_delChar,1,1);
    v_lenString := v_Pos - 1;
    v_record_layer := substr(v_input_buffer,1,v_lenString);
    v_startPos := v_Pos + 1;
    -- this will read the 2nd field from the file --
    v_Pos := instr(v_input_buffer,v_delChar,1,2);
    v_lenString := v_Pos - v_startPos;
    v_desc1 := substr(v_input_buffer,v_startPos,v_lenString);
    v_startPos := v_Pos + 1;
    -- this will read the 3rd field from the file --
    v_Pos := instr(v_input_buffer,v_delChar,1,3);
    v_lenString := v_Pos - v_startPos;
    v_desc2 := substr(v_input_buffer,v_startPos,v_lenString);
    v_startPos := v_Pos + 1;
    -- this will read the 4th field from the file --
    v_Pos := instr(v_input_buffer,v_delChar,1,4);
    v_lenString := v_Pos - v_startPos;
    v_desc3 := substr(v_input_buffer,v_startPos,v_lenString);
    v_startPos := v_Pos + 1;
    -- this will read the 5th field from the file --
    v_Pos := instr(v_input_buffer,v_delChar,1,5);
    v_lenString := v_Pos - v_startPos;
    v_desc4 := substr(v_input_buffer,v_startPos,v_lenString);
    v_startPos := v_Pos + 1;
    v_str := 'insert into table sps_dataload values('||v_filename||','||v_record_layer||','||v_level_id||','||v_desc1||','||v_desc2||','||v_desc3||','||v_desc4||')';
    Execute immediate v_str;
    p_Totalinserted := p_Totalinserted + 1;
    commit;
    END LOOP;
    UTL_FILE.FCLOSE(v_filehandle);
    EXCEPTION
    WHEN UTL_FILE.INVALID_OPERATION THEN
    UTL_FILE.FCLOSE(v_FileHandle);
    RAISE_APPLICATION_ERROR(-20051, 'sps_dataload: Invalid Operation');
    WHEN UTL_FILE.INVALID_FILEHANDLE THEN
    UTL_FILE.FCLOSE(v_FileHandle);
    RAISE_APPLICATION_ERROR(-20052, 'sps_dataload: Invalid File Handle');
    WHEN UTL_FILE.READ_ERROR THEN
    UTL_FILE.FCLOSE(v_FileHandle);
    RAISE_APPLICATION_ERROR(-20053, 'sps_dataload: Read Error');
    WHEN UTL_FILE.INVALID_PATH THEN
    UTL_FILE.FCLOSE(v_FileHandle);
    RAISE_APPLICATION_ERROR(-20054, 'sps_dataload: Invalid Path');
    WHEN UTL_FILE.INVALID_MODE THEN
    UTL_FILE.FCLOSE(v_FileHandle);
    RAISE_APPLICATION_ERROR(-20055, 'sps_dataload: Invalid Mode');
    WHEN UTL_FILE.INTERNAL_ERROR THEN
    UTL_FILE.FCLOSE(v_FileHandle);
    RAISE_APPLICATION_ERROR(-20056, 'sps_dataload: Internal Error');
    WHEN VALUE_ERROR THEN
    UTL_FILE.FCLOSE(v_FileHandle);
    RAISE_APPLICATION_ERROR(-20057, 'sps_dataload: Value Error');
    WHEN OTHERS THEN
    UTL_FILE.FCLOSE(v_FileHandle);
    RAISE;
    END insert_spsdataloader;
    /

    Justin, thanks. I did happen to change my pl sql procedure using utl_file.get_file and modifying the instr function based on position of ',' in the file, but my procedure is getting really big and too complex to debug. So I got motivated to use external tables or sql loader as plan b.
    As I was reading more about creating an external table as an efficient way and thus believe I can perhaps build an extern table with my varying selection from the file. But I am still unclear if I can construct my external table by choosing different fields in a record based on a record identifier string value (which is the first field of any record). I guess I can, but I am looking for the construct as to how am I going to use the instr function for selecting the field from the file while creating the table.
    PROSPACE SCHEMATIC FILE
    ; Version 2007.7.1
    Project,abc xyz Project,,1,,7,1.5,1.5,1,1,0,,0,1,0,0,0,0,3,1,1,0,1,0,0,0,0,2,3,1,0,1,0,0,0,0,3,3,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    Subproject,25580-1005303.pst,,102,192,42,12632256,1,1,102,192,42,1,12632256,0,6,1,0,32896,1,0,0,0,0,,,-1,-1,-1,-1,0,0,0,-1,-1,-1,-1,-1,-1,0,0,0,-1,-1,-1,-1,-1,-1,0,0,0,-1,-1,0,1,1,,,,,,1
    Segment, , , 0, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, , , , , , , , , , , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, , , 1
    Product,00093097000459,26007,2X4 MF SF SD SOLR,,28.25,9.5,52.3, 8421504,,0,,xyz INC.,SOLAR,,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,1,000000.60,0,0,0,0,00,-1,0
    Product,00093097000329,75556,"22""X22"" BZ CM DD 1548",,27,7,27, 8421504,,0,,xyz INC.,SOLAR,,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,1,000000.20,0,0,0,0,0,0,0,,345.32
    Product,00093097000336,75557,"22""X46"" BZ CM XD 48133",,27,7.5,51, 8421504,,0,,xyz INC.,SOLAR,,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,1,000000.20,0,0,0,0,0,0,0,0
    Product,00093097134833,75621,"22""X22"" BZ CM/YT DD 12828",,27,9,27, 8421504,,0,,xyz INC.,SOLAR,,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,1,000000.20,0,0,0,0,0,0,0,,1For example, if I want to create an external table like this -
    CREATE TABLE extern_sps_dataload
    ( record_layer            VARCHAR2(20),
      attr1                   VARCHAR2(20),
      attr2                   VARCHAR2(20),
      attr3                   VARCHAR2(20),
      attr4                   VARCHAR2(20)
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
      DEFAULT DIRECTORY dataload
      ACCESS PARAMETERS
      ( RECORDS DELIMITED BY NEWLINE
        BADFILE     dataload:'sps_dataload.bad'
        LOGFILE     dataload:'sps_dataload.log'
        DISCARDFILE dataload:'sps_dataload.dis'
        SKIP 2
        VARIABLE 2 FIELDS TERMINATED BY ',' 
        OPTIONALLY ENCLOSED BY '"' LRTRIM
        MISSING FIELD VALUES ARE NULL
        +LOAD WHEN RECORD_LAYER = 'PROJECT' (FIELD2, FIELD3,FIELD7,FIELD9)+
        +LOAD WHEN RECORD_LAYER= 'PRODUCT' (FIELD3,FIELD4,FIELD8,FIELD9)+
        +LOAD WHEN RECORD_LAYER= 'SEGMENT' (FIELD1,FIELD2,FIELD4,FIELD5)+    LOCATION ('sps_dataload.csv')
    REJECT LIMIT UNLIMITED;
    {code}
    While I was reading the external table documentation, I thought I could achieve similar things by using position_spec option, but I am not getting behind its parameters. I have highlighted italics in the code above(from LOAD WHEN....FIELDS....), the part I think I am going to use, but not sure of it's construct.
    Thank you for your help!! Appreciate your thoughts on this..
    Sanders.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Read from csv file and graph at certain interval

    Hi,
    I've been trying all day to modify a labView program so it reads in data from my csv file to graph temperatures from 4 ovens. The temperatures are logged in the csv file at 3s intervals and i wish to display them on 4 graphs. I've written a vi (or modified one i should say) to take in a temperature value from a numeric control. Im just having extreme difficulty with the reading part.
     If someone can help me it would be greatly appreciated.
    Best regards,
    Dawn
    Attachments:
    Oven temps.csv ‏2 KB
    Oven_level_meas.vi ‏58 KB

    Hi there,
    I have a similar problem here.  I see your point that you should read the file at once but I don't seem to be able to manage it.  Shouldn't you use some kind of
    a buffer to achieve this?  Let me tell you what I am trying to do:  I have a csv file with several columns that I want to display in several waveform charts.  Each column is a wavechart.  I should be able to change the speed at which the data is displayed.  I am able to do this because I change the wait until (ms) in the for loop.  However the application is too slow.  I think because I open the csv file in the for loop and display it while I am reading it.  I have tried to put it outside the for loop but this doesn't work.  I think I need some kind of a buffer in which the data is stored after reading it.  And then this buffer should be used in the for loop.  I have looked at the producer-consumer structure but I dont fully understand it as I am not that experienced with labview.  Any help or changes to my VI would be appreciated.  I have attached the VI and the file with meaningless data I am using for testing.
    Thanks
    Attachments:
    read_data_file_dynamically.vi ‏39 KB
    test.CSV ‏332 KB

  • Csv file reading and voltage and current plotting with respect to time samples XY plotting

    Hallo,
             I've been struggling with reading  a comma separated value (csv) file from another instrument (attached). I need to plot this data for analysis. I have 5 column of data with numbers of rows, the first three row is the information of the measurement. I want to read 4th row as string and rest of the row as numbers. I want to plot 2nd column (i1)  with respect to TIMESTAMP; 4th column(u2) wrt TIMESTAMP. And finally plotting i1 (x-axis) vs.. u2 (y-axis) in labview. Could anyone help me.
    In excel its so easy to plot  but I don't know how its done in labview.
    Attachments:
    labview forum test.csv ‏30 KB
    excel plot.jpg ‏88 KB

    Start by opening the file.  Then use the Read Text File function.  You can right-click on it and configure it to read lines.  First make it read 3 lines (this is your extra header data).  Then make it read a single line.  That will give you your channel names.  Then read the rest of the file (disable the read by line and wire a -1 into the number of bytes to read).  Then use the Spreadsheet String to Array function to give you your data.
    I would recommend going through the LabVIEW tutorials if you are really new at this.
    LabVIEW Basics
    LabVIEW 101
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Tables of pr05

    Hi,somebody knows what tables use the transaction pr05(travel expense manager), I need the data of receipts but I don't find what tables to use.

  • How to erase selected cookies in Safari?

    Hello everyone, I found how to erase ALL cookies but not how too erase selected ones only. Is that possible? (iPad, latest iOs) Thanks

  • Load image with ImageIcon component

    Hello, I want to load an image whose name or path contains special character such as accents (a french name). So that generates an exception. For exemple for an image named caf�.jpeg I obtain this message : java.io.FileNotFoundException: /media/disk/

  • Page formatting errors

    It seems that the kudos page for the ideas exchange has some formatting errors: The links for next page...previous page, seem to contain some internal label (simplepaging.next-page.title, etc.) Message Edited by altenbach on 06-30-2009 07:52 AM LabVI

  • HT201210 bloqued ipod touch , 8 Gb . Wrong code . what do i do ?

    Bonjour , je ne me souviens plus de mon code de verouillage ipod touch ( par chiffres ) je ne sais pas quoi faire ?