How to read columns of a Microsoft Excel .csv file with LabVIEW?

This should be simple.  Any ideas on how to read an Excel file with csv extension using LabVIEW?
Thanks!

Use the Read From SpeadSheet File.VI which you can find on the FILE I/O pallette.
"Read From Spreadsheet File
Reads a specified number of lines
or rows from a numeric text file beginning at a specified character offset and
converts the data to a 2D, single-precision array of numbers. You optionally can transpose the
array. The VI opens the file before reading from it and closes it afterwards.
You can use this VI to read a spreadsheet file saved in text format. This VI
calls the Spreadsheet String
to Array function to convert the data."
The CSV file is essentially a text file which uses commas as delimiters in the files structure.

Similar Messages

  • How to read the second line in a .txt file with bufferedReader?

    hi,
    i am not the best in speaking english and programming java :)
    so, just try to make sense of my question:
    Im using a BufferedReader to read a .txt file.
    the .txt file has 5+ different lines, and each line has 6 tokens (separated with ; )
    My java file has 6 textFields and each textfield is filled with one of the 6 different tokens.
    and my problem is:
    I want my buffered reader to read the next line (with 6 new different tokens) by pressing a button.
    if somethings not understandable, just ask :)

    maybe its easier to help me, when i publish my code, so here it is:
    (its my version, without Thof's code. Sorry, but the comments are the most in german)
    /* userdata.java */
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    public class userdata extends Frame {
    //-----------------------------------KlassenVariablen------------------------------------------------
    private JPanel panel = new JPanel ();
    String tokId = "";
    String tokName= "";
    String tokAge= "";
    String tokTel= "";
    String tokMail= "";
    String tokText= "";
    BufferedReader br;
    String zeile;
    StringTokenizer st;
    String delim = ";";
    //---------Buttons f?r Panel 1-------------------------
    Button first = new Button("|< First");
    Button back = new Button("< Back");
    Button next = new Button("Next >");
    Button last = new Button("Last >|");
    //---------Buttons f?r Panel 3-------------------------
    Button neu = new Button("New");
    Button safe = new Button("Safe");
    Button refresh = new Button("Refresh");
    //--------Labels f?r Panel 2-----------------------------
    Label lid = new Label("ID",Label.LEFT);
    Label lname = new Label("Name",Label.LEFT);
    Label lage = new Label("Age",Label.LEFT);
    Label ltel = new Label("Tel.",Label.LEFT);
    Label lmail = new Label("E-Mail",Label.LEFT);
    Label ltext = new Label("Spruch",Label.LEFT);
    Label lub = new Label("Last Button",Label.LEFT);
    TextField id = new TextField();
    TextField name = new TextField();
    TextField age = new TextField();
    TextField tel = new TextField();
    TextField mail = new TextField();
    TextField text = new TextField();
    TextField usedbutton = new TextField();
    //--------ActionEvent bla sachen eben--------------------
    public static void main (String[] args) throws IOException {
    userdata wnd = new userdata();
    wnd.setVisible(true);
    public userdata() throws IOException {                                                                                                                                                                                                                                                                                
    //--------------------------------Layout mit panel bestimmung--------------------------------------
    setLayout(new BorderLayout());
    JPanel p1 = new JPanel();
    JPanel p2 = new JPanel();
    JPanel p3 = new JPanel();
    add(BorderLayout.NORTH ,p1);
    add(BorderLayout.CENTER , p2);
    add(BorderLayout.SOUTH , p3);
    //-------------------------------Funktionslose Buttons in PANEL 1------------------------------------
    p1.add(first);
    p1.add(back);
    p1.add(next);
    p1.add(last);
    p1.add(usedbutton);
    //--------------------------------Funktionierende Textfelder in PANEL 2------------------------------
    Panel labelpanel = new Panel();
    p2.setLayout(new GridLayout(7,3));
    p2.add(lid);
    p2.add(id);
    p2.add(lname);
    p2.add(name);
    p2.add(lage);
    p2.add(age);
    p2.add(ltel);
    p2.add(tel);
    p2.add(lmail);
    p2.add(mail);
    p2.add(ltext);
    p2.add(text);
    p2.add(lub);
    p2.add(usedbutton);
    //--------------------------------------Buttons in PANEL 3-----------------------------------------
    p3.add(neu);
    p3.add(safe);
    p3.add(refresh);
    //--------------------------------BufferedReader -------------------------------------------------
    readData();
    //--------------------------------Panel 2 TextField-----------------------------------------------
    fillForm();
    //================================ActionPerformed==================================================
    first.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("First");
    usedbutton.setText("First");
    back.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("Back");
    usedbutton.setText("Back");
    next.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("Next");
    usedbutton.setText("Next");
    last.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("Last");
    usedbutton.setText("Last");
    neu.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("New entry");
    usedbutton.setText("New");
    safe.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("Now Saving, do not turn off!");
    usedbutton.setText("Save");
    //-----------------refresh
    refresh.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    try{
    readData();
    }catch( IOException ioe){
    System.out.println("Fehler beim lesen aus Datei");
    fillForm();
    usedbutton.setText("Refresh");
    //=============================================================================Button Funktionen!!!
    pack();
    //--------------------------------WindowsListener hinzuf?gene--------------------------------------
    addWindowListener(
    new WindowAdapter() {
    public void windowClosing(WindowEvent event)
    setVisible(false);
    dispose();
    System.exit(0);
    //-----------------------------------readData() - > Buffered Reader in aktion! --------------------
    private void readData() throws IOException{
    BufferedReader br = new BufferedReader(new FileReader("My .txt File with path"));
    String zeile;
    StringTokenizer st;
    String delim = ";";
    zeile = br.readLine();
    st = new StringTokenizer(zeile, delim);
    st.hasMoreTokens();
    //System.out.println (st.nextToken());
    tokId = new String(st.nextToken());
    tokName = new String (st.nextToken());
    tokAge = new String (st.nextToken());
    tokTel = new String (st.nextToken());
    tokMail = new String (st.nextToken());
    tokText = new String (st.nextToken());
    //--------------------------fillForm() - > f?llt die TextFelder aus!--------------------------------
    private void fillForm(){
    id.setText(tokId);
    name.setText(tokName);
    age.setText(tokAge);
    tel.setText(tokTel);
    mail.setText(tokMail);
    text.setText(tokText);
    }

  • How to export XY graph picture to clipboard (or file) with labview 6i

    Hello,
    I would like to export XY graph picture to clipboard (or file) to insert it in a word document using labview 6i
    I found example for labview 8 using invokenode but not with labview 6i
    But this invokenode doesn't exist in labview 6i : here's what I found in labview 6i
     Does anyone knows how to use this one ?
    thanks in advance
    Solved!
    Go to Solution.

    I would recommend you use Write PNG File.vi instead of Write JPG File.vi unless the place you are using it cannot handle PNGs.  The PNG will be much better quality and should be about the same size for this type of image.
    Message Edited by DFGray on 02-03-2010 07:22 AM
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • JDBC vs excell csv file

    Hi All,
    Could JDBC API read off values from an excell csv file? Such that they could be transferred easily to JTables? Thanx again ^^

    you could configure the "Microsoft Text Driver" (which is for CSV and text files), from 32-bit ODBC option of control panel in Windows Systems (if u r using windows).
    Then u can query using normal JDBC SQL syntax,
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:myDsn");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("select * from myCsvFile.csv");
    Priya.

  • Vc++ how to read column header of cursor

    How to fetch the Column name or header of the stored procedure which is using a cursor as the output.
    P_out  out sys_refcursor
    need to read the column name of this output.
    I am using Vc++ code to reterive the data, in Vc++ how to read column header of cursor

    You haven't provided much detail to go on.  How are you reading data from the ref cursor? Do you already have a reader from it?
    Maybe this helps.
    Greg
    create or replace procedure proc1 (v1 out sys_refcursor) as
    begin
    open v1 for select * from emp;
    end;
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public class RefCur
        public static void Main()
            using (OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl"))
                con.Open();
                using (OracleCommand cmd = new OracleCommand("proc1", con))
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new OracleParameter("v1", OracleDbType.RefCursor, ParameterDirection.Output));
                    cmd.ExecuteNonQuery();
                    using (OracleDataReader reader = ((OracleRefCursor)cmd.Parameters[0].Value).GetDataReader())
                        for (int i=0;i<reader.FieldCount;i++)
                            Console.WriteLine(reader.GetName(i));

  • How to read data from a zipped MS Access file?

    How to read data from a zipped MS Access file?

    RPJ,
    You do not need to use the Close Zip File.vi when you unzip a folder.  This VI is used when you are creating a zip folder.
    As for examples, I found a couple of ActiveX based MS Access examples.  These programs look to be pretty basic.  For more in depth example I would search Microsoft Developers Network
    http://zone.ni.com/devzone/cda/epd/p/id/2188
    http://zone.ni.com/devzone/cda/epd/p/id/1694
    Regards,
    Jon S.
    National Instruments
    LabVIEW R&D

  • How to import data from CSV file with columns separated by semicolon?

    I migrate database from MS SQL 2008 to ORACLE 11g
    I export data to CSV file from MS SQL
    then I try to import it to Oracle
    several tables goes fine using Import data option in the SQL Developer
    Standard CSV files with data separated by comma were imported.
    chars, date (with format string), and integer data are imported via import wizard without problems
    the problems were when I try to import table with noninteger numbers with modal part separated by comma not by dot
    comma is the standard separator for columns in CSV file
    so I must change the standard separator to semicolon
    then the import wizard have problem to correct recognize the columns data because it use only standard CSV comma separator :-/
    In SQL Developer 1.5.3 Tools -> Preferences -> Migration -> Data Move Options
    I change "End of Column Delimiter" to ; but it doens't work
    Is this possible to change the standard column separator for import data wizzard in SQL Developer 1.5.3?
    Or maybe someone know how to import data in SQL Developer 1.5.3 from CSV when CSV colunn separator is set to semicolon?

    A new preference has been added to customize the import delimiter in main code line. This should be available as part of future release.

  • How to get string (specified by line and column) from txt file with labview

    Hi everyone
    How to get string (specified by line and column) from txt file with labview
    thx 
    Solved!
    Go to Solution.

    As far as I know, a text file has no columns.  Please be more specific.  Do you mean something like the 5th word on line 4, where words are separated by a space, and lines are separated by a newline character?  You could the Read from Spreadsheet String function and set the delimiter to a space.  This will produce a 2D array of strings.  Then use index array and give the line number and column number.
    - tbob
    Inventor of the WORM Global

  • Is Microsoft Excel 2008 compatible with OS 9?

    Is Microsoft Excel 2008 compatible with OS 9?

    You are posting in the discussion of Yosemite, Mac OS X 10.10, area.  But no, Excel 2008, as part of Office 2008, will require an Intel processor and Mac OS X 10.x version.

  • Programatically pick PowerView properties from Microsoft Excel 2013 file

    Hi,
    I have a requirement to programmatically read/handle PowerView properties like title, theme, background, font-size etc. from a Microsoft Excel 2013 file. Also I need to access the properties of the objects which are added on to the PowerView,
    for e.g. properties of a table or a image added to the PowerView.
    I have been looking for it since long, but no luck. Is there a way by which I can achieve it? Any pointers regarding this would be really helpful.
    Thanks in advance.

    Thanks Simon_Hou for the response.
    As per your answer, PowerView is an add-on and hence it is packaged and properties can't be picked.
    But, PowerPivot is also a com add-in still there exists a programming handle for it. We are able to pick several properties for PowerPivot using Interop.
    For PowerView, I am able to see certain bin files getting created but am unable to pick any information from those.
    (Bin files namely CustomProperties1.bin, CustomProperties2.bin, CustomProperties3.bin, CustomProperties4.bin, CustomProperties5.bin)
    Is there any way by which we can pick certain properties for Power View as well using these files or maybe some other way?

  • How to read and update the value of property file

    Hi,
    I am not able read the values from property file.
    Please tell me how to read and update the values from property file using Properties class
    This is my property file : - Config.properties its located in D:\newfolder
    Values
    SMTP = localhost
    Now i need to change the value of the SMTP
    New value :
    SMTP =10.60.1.9
    Pls Help me
    Thanks
    Merlin Rosina,

    Post a small (<1 page) example program that forum members can copy and run that demonstrates your problem.

  • How to read and write a data from extrenal file

    Hi..
    How to read and write a data from extrenal file using Pl/sql?
    Is it possible from Dyanamic Sql or any other way?
    Reagards
    Raju

    utl_file
    Re: How to Create text(dat) file.
    Message was edited by:
    jeneesh

  • Reading a csv file with a large number of columns

    Hello
    I have been attempting to read data from large csv files with 38 columns by reading a line using readline and scanning the linebuffer using scan.
    The file size can be up to 100 MB.
    Scan does not seem support the large number of fields.
    Any suggestions on reading the 38 comma separated fields. There is one header line in the file.
    Thanks
    Solved!
    Go to Solution.

    see if strtok() is useful  http://www.elook.org/programming/c/strtok.html

  • How to generate a second csv file with different report columns selected?

    Hi. Everybody:
    How to generate a second csv file with different report columns selected?
    The first csv file is easy (report attributes -> report export -> enable CSV output Yes). However, our users demand 2 csv files with different report columns selected to meet their different needs.
    (The users don't want to have one csv file with all report columns included. They just want to get whatever they need directly, no extra columns)
    Thank you for any help!
    MZ

    Hello,
    I'm doing it usually. Typically example would be in the report only the column "FIRST_NAME" and "LAST_NAME" displayed whereas
    in the csv exported with the UTL_FILE the complete address (street, housenumber, additions, zip, town, state ... ) is written, these things are needed e.g. the form letters.
    You do not need another page, just an additional button named e.g. "export_to_csv" on your report page.
    The csv export itself is handled from a plsql procedure "stored procedure" ( I like to have business logic outside of apex) which is invoked by pressing the button "export_to_csv". Of course the stored procedure can handle also parameters
    An example code would be something like
    PROCEDURE srn_brief_mitglieder (
         p_start_mg_nr IN NUMBER,
         p_ende_mg_nr IN NUMBER
    AS
    export_file          UTL_FILE.FILE_TYPE;
    l_line               VARCHAR2(20000);
    l_lfd               NUMBER;
    l_dateiname          VARCHAR2(100);
    l_datum               VARCHAR2(20);
    l_hilfe               VARCHAR2(20);
    CURSOR c1 IS
    SELECT
    MG_NR
    ,TO_CHAR(MG_BEITRITT,'dd.mm.yyyy') AS MG_BEITRITT ,TO_CHAR(MG_AUFNAHME,'dd.mm.yyyy') AS MG_AUFNAHME
    ,MG_ANREDE ,MG_TITEL ,MG_NACHNAME ,MG_VORNAME
    ,MG_STRASSE ,MG_HNR ,MG_ZUSATZ ,MG_PLZ ,MG_ORT
    FROM MITGLIEDER
    WHERE MG_NR >= p_start_mg_nr
    AND MG_NR <= p_ende_mg_nr
    --WHERE ROWNUM < 10
    ORDER BY MG_NR;
    BEGIN
    SELECT TO_CHAR(SYSDATE, 'yyyy_mm_dd' ) INTO l_datum FROM DUAL;
    SELECT TO_CHAR(SYSDATE, 'hh24miss' ) INTO l_hilfe FROM DUAL;
    l_datum := l_datum||'_'||l_hilfe;
    --DBMS_OUTPUT.PUT_LINE ( l_datum);
    l_dateiname := 'SRNBRIEF_MITGLIEDER_'||l_datum||'.CSV';
    --DBMS_OUTPUT.PUT_LINE ( l_dateiname);
    export_file := UTL_FILE.FOPEN('EXPORTDIR', l_dateiname, 'W');
    l_line := '';
    --HEADER
    l_line := '"NR"|"BEITRITT"|"AUFNAHME"|"ANREDE"|"TITEL"|"NACHNAME"|"VORNAME"';
    l_line := l_line||'|"STRASSE"|"HNR"|"ZUSATZ"|"PLZ"|"ORT"';
         UTL_FILE.PUT_LINE(export_file, l_line);
    FOR rec IN c1
    LOOP
         l_line :=  '"'||rec.MG_NR||'"';     
         l_line := l_line||'|"'||rec.MG_BEITRITT||'"|"' ||rec.MG_AUFNAHME||'"';
         l_line := l_line||'|"'||rec.MG_ANREDE||'"|"'||rec.MG_TITEL||'"|"'||rec.MG_NACHNAME||'"|"'||rec.MG_VORNAME||'"';     
         l_line := l_line||'|"'||rec.MG_STRASSE||'"|"'||rec.MG_HNR||'"|"'||rec.MG_ZUSATZ||'"|"'||rec.MG_PLZ||'"|"'||rec.MG_ORT||'"';          
    --     DBMS_OUTPUT.PUT_LINE (l_line);
    -- in datei schreiben
         UTL_FILE.PUT_LINE(export_file, l_line);
    END LOOP;
    UTL_FILE.FCLOSE(export_file);
    END srn_brief_mitglieder;Edited by: wucis on Nov 6, 2011 9:09 AM

  • How can I create a new excel workbook only with labview

    Hi everyone...
    I'm trying to create a new excel workbook only with labview but I can't find the file in the hard disk.
    Someone knows?
    Labview 8,0
    Attachments:
    Create new WB with LV.vi ‏18 KB

    You are not using the correct mechanism. Pull up the Example Finder in LabVIEW, click on the "Search" tab, and enter "Excel". Look for an example called "Write Table to XL". Use this as a starting point for creating new workbooks and adding data to it.
    Note: on disk the example is at <LabVIEW install directory>\examples\comm\ExcelExamples.llb.
    Message Edited by smercurio_fc on 06-05-2007 11:08 AM

Maybe you are looking for

  • HT1428 Log into FileVault gives error on disk try again later. This is only account on system how do I log in to do disk repair. MacBook Pro running lion

    Only have 1 account on MacBook Pro. Protected by FileVault. Log in  says your home folder didn't open. It needs repaired. We click ok. Unable to login to account at this time.  Account failed because error occurred.   Everything I have read so far ha

  • How to recover a missing program

    Hi guys Im facing an issue on our SLM system where one of the Z programs is missing. I've checked on SE38 and the program is not listed. I have tried to check on Version Management but there are no previous versions. The only activity was a EHP 1 Upg

  • ITunes 11: iPad 3 not syncing

    I upgraded to iTunes 11 yesterday and now I can't get back my iPad 3 to sync. It is being recognized and shows up in iTunes, but when I click the "Sync" button, it starts syncing, backs up okay but also quits in the middle of "Determining which Apps

  • Fund & Gl Account Assignement

    I have created a Fund in FM5I but I don'yt know where to attach a Fund Centre to a GL Account. Can some one help me Kiran

  • Trouble after down loading photos

    Hi I am very thick with computers and need help recently I can't get the photos I down load to stay they down load do iphone cameras etc but when I go out of the program then go back in nothing is their no in last imported,events albums etc don't no