How to read data from many excel files

I'm aquiring data continusly from several sensors, and every days file name are changed. Data are saved on xls files.
Now, I'd like to read every data from this files and put them in a waveform. How can I concatenate all files and read the values?

You probably do not want to use a traditional waveform. LabVIEW has a Waveform Chart which inputs one point at a time. Waveform Graph inputs an array.
I suspect that the data is stored in an array. You need to read the arrays in and build them into larger arrays. If your right click on the build array vi, you can select concantenate which will append one array to the end of the other. When you have built your giant array, just feed it to a waveform graph.
If you need to see some example code, go to the advanced search page. It is at www.ni.com >> support >> advanced search (it is at the botton--click on the words). Enter excel read in the all the words field and search just the example programs. There were for hits.
Jeremy Braden
National Ins
truments

Similar Messages

  • Help! How to read data from an Excel file?

    Hi,
    I need to read data from an Excel file that may contain more then one table in a sheet. How can I read them?
    I would be eternally grateful to anyone who can give me any information.

    Did you try POI from Apache?
    http://jakarta.apache.org/poi/index.html

  • How to read data from the excel file using java code.

    Hi to all,
    I am using below code to getting the data from the excel file but I can't get the corresponding data from the specific file. can anyone give me the correct code to do that... I will waiting for your usefull reply......
    advance thanks....
    import java.io.*;
    import java.sql.*;
        public class sample{
                 public static void main(String[] args){
                      Connection connection = null;
                          try{
                               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                               Connection con = DriverManager.getConnection( "jdbc:odbc:Mydsn","","" );
                               Statement st = con.createStatement();
                               ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );
                               System.out.println("sample:"+rs);
                                  ResultSetMetaData rsmd = rs.getMetaData();
                                  System.out.println("samplersd:"+rsmd);
                               int numberOfColumns = rsmd.getColumnCount();
                                  System.out.println("numberOfColumns:"+numberOfColumns);
                                   while (rs.next()) {
                                            System.out.println("sample1:"+rs);
                                            for (int i = 1; i <= numberOfColumns; i++) {
                                                 if (i > 1) System.out.print(", ");
                                                 String columnValue = rs.getString(i);
                                                 System.out.print(columnValue);
                                            System.out.println("");
                                       st.close();
                                       con.close();
                                      } catch(Exception ex) {
                                           System.err.print("Exception: ");
                                           System.err.println(ex.getMessage());
                        }

    1: What is the name of the excel sheet?
    2: What is printed in this program? null ? anything?
    error?Excel file name is "sample.xls" I set excel file connectivity in my JDBC driver(DSN). Here in my program I am not giving that excel file name. I am giving only that excel sheet name. that is followed
    ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );The output of this program is given bellow.
    sample:sun.jdbc.odbc.JdbcOdbcResultSet@1b67f74
    samplersd:sun.jdbc.odbc.JdbcOdbcResultSetMetaData@530daa
    numberOfColumns:2

  • Reading data from an excel file

    Hi,
    I want to read data from the excel file and display it in
    jsp page. Iam getting the following error:
    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con =
    DriverManager.getConnection("jdbc:odbc:mydsn","","");
    Statement st = con.createStatement();
    ResultSet rs = st.executeQuery("select * from [holidays$]");
    Here i have created the dsn with the name "mydsn". I have the
    following data in the mydsn.dsn file:
    [ODBC]
    DRIVER=Microsoft Excel Driver (*.xls)
    UID=admin
    UserCommitSync=Yes
    Threads=3
    SafeTransactions=0
    ReadOnly=1
    PageTimeout=5
    MaxScanRows=8
    MaxBufferSize=2048
    FIL=excel 8.0
    DriverId=790
    DefaultDir=D:\WorkSpace\Projects\VINET\devl\webroot\jsp
    DBQ=D:\WorkSpace\Projects\VINET\devl\webroot\jsp\list_of_holidays_2003.xls
    thanks in advance
    phani.

    You might want to look at the POI project (an open source Jakarta sub-project) that allows you to create/modify/read excel files via Java code. That might be more flexible and easier than what you're currently trying to do.
    Cheers

  • GUI_UPLOAD to read data from an Excel File

    Hi Folks,
    I'm using FM GUI_UPLOAD to read data from an Excel File. But all I see in the table returned is 1 row with garbage values (special chacaters). Excel Workbook has proper data in the sheet, but its not getting uploaded properly. Sy-subrc is 0.
    What could be the reason?
    Thanks

    use FM : ALSM_EXCEL_TO_INTERNAL_TABLE
    See the example program to get from XLS file to Internal table
    REPORT ZLWMI151_UPLOAD no standard page heading
                           line-size 100 line-count 60.
    *tables : zbatch_cross_ref.
    data : begin of t_text occurs 0,
           werks(4) type c,
           cmatnr(15) type c,
           srlno(12) type n,
           matnr(7) type n,
           charg(10) type n,
           end of t_text.
    data: begin of t_zbatch occurs 0,
          werks like zbatch_cross_ref-werks,
          cmatnr like zbatch_cross_ref-cmatnr,
          srlno like zbatch_cross_ref-srlno,
          matnr like zbatch_cross_ref-matnr,
          charg like zbatch_cross_ref-charg,
          end of t_zbatch.
    data : g_repid like sy-repid,
           g_line like sy-index,
           g_line1 like sy-index,
           $v_start_col         type i value '1',
           $v_start_row         type i value '2',
           $v_end_col           type i value '256',
           $v_end_row           type i value '65536',
           gd_currentrow type i.
    data: itab like alsmex_tabline occurs 0 with header line.
    data : t_final like zbatch_cross_ref occurs 0 with header line.
    selection-screen : begin of block blk with frame title text.
    parameters : p_file like rlgrap-filename obligatory.
    selection-screen : end of block blk.
    initialization.
      g_repid = sy-repid.
    at selection-screen on value-request for p_file.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                PROGRAM_NAME = g_repid
           IMPORTING
                FILE_NAME    = p_file.
    start-of-selection.
    Uploading the data into Internal Table
      perform upload_data.
      perform modify_table.
    top-of-page.
      CALL FUNCTION 'Z_HEADER'
      EXPORTING
        FLEX_TEXT1       =
        FLEX_TEXT2       =
        FLEX_TEXT3       =
    *&      Form  upload_data
          text
    FORM upload_data.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                FILENAME                = p_file
                I_BEGIN_COL             = $v_start_col
                I_BEGIN_ROW             = $v_start_row
                I_END_COL               = $v_end_col
                I_END_ROW               = $v_end_row
           TABLES
                INTERN                  = itab
           EXCEPTIONS
                INCONSISTENT_PARAMETERS = 1
                UPLOAD_OLE              = 2
                OTHERS                  = 3.
      IF SY-SUBRC <> 0.
        write:/10 'File '.
      ENDIF.
      if sy-subrc eq 0.
        read table itab index 1.
        gd_currentrow = itab-row.
        loop at itab.
          if itab-row ne gd_currentrow.
            append t_text.
            clear t_text.
            gd_currentrow = itab-row.
          endif.
          case itab-col.
            when '0001'.
              t_text-werks = itab-value.
            when '0002'.
              t_text-cmatnr = itab-value.
            when '0003'.
              t_text-srlno = itab-value.
            when '0004'.
              t_text-matnr = itab-value.
            when '0005'.
              t_text-charg = itab-value.
          endcase.
        endloop.
      endif.
      append t_text.
    ENDFORM.                    " upload_data
    *&      Form  modify_table
          Modify the table ZBATCH_CROSS_REF
    FORM modify_table.
      loop at t_text.
        t_final-werks = t_text-werks.
        t_final-cmatnr = t_text-cmatnr.
        t_final-srlno = t_text-srlno.
        t_final-matnr = t_text-matnr.
        t_final-charg = t_text-charg.
        t_final-erdat = sy-datum.
        t_final-erzet = sy-uzeit.
        t_final-ernam = sy-uname.
        t_final-rstat = 'U'.
        append t_final.
        clear t_final.
      endloop.
      delete t_final where werks = ''.
      describe table t_final lines g_line.
      sort t_final by werks cmatnr srlno.
    Deleting the Duplicate Records
      perform select_data.
      describe table t_final lines g_line1.
      modify zbatch_cross_ref from table t_final.
      if sy-subrc ne 0.
        write:/ 'Updation failed'.
      else.
        Skip 1.
        Write:/12 'Updation has been Completed Sucessfully'.
        skip 1.
        Write:/12 'Records in file ',42 g_line .
        write:/12 'Updated records in Table',42 g_line1.
      endif.
      delete from zbatch_cross_ref where werks = ''.
    ENDFORM.                    " modify_table
    *&      Form  select_data
          Deleting the duplicate records
    FORM select_data.
      select werks
             cmatnr
             srlno from zbatch_cross_ref
             into table t_zbatch for all entries in t_final
             where werks = t_final-werks
             and  cmatnr = t_final-cmatnr
             and srlno = t_final-srlno.
      sort t_zbatch by werks cmatnr srlno.
      loop at t_zbatch.
        read table t_final with key werks = t_zbatch-werks
                                    cmatnr = t_zbatch-cmatnr
                                    srlno = t_zbatch-srlno.
        if sy-subrc eq 0.
          delete table t_final .
        endif.
        clear: t_zbatch,
               t_final.
      endloop.
    ENDFORM.                    " select_data

  • How to retrieve data from an Excel file which is located on server

    hi everybody,
                    I am using SAP NWDS 2004s .     
                I have done an application on how to export the table data into an Excel .
    Now i want to get the data from an Excel file which is located in server and display that data which is in excel in a View for example a Sample view in Webdynpro  .
    In Sample view i took a uielement textview to display the data ....   
    can any one help how to procced further
    Thanks in advance
    Madhavi

    Options to read Excel data to WebDynpro context
    Reading Excel Sheet from Java without using any Framework
    Reading Multiple Sheets of Excel Sheet from Java
    Few Threads
    How to Display the content of Excel file into Webdynpro Table
    Is it possible to upload data from excel file(.xls)
    Re: How to export the data as integer into excel sheet?
    regards
       Vinod

  • How to read data from a excel and HTML file

    Hi
        I am writing an 2D-array of string into Excel/HTML file using Report generation.
        Can anybody tell me how to retrieve back the written data from the same files again and view in array format.
    Thanks & regards
    Visuman 
    Solved!
    Go to Solution.

    you can use activex to read the data from the excel fileback in the array format...go through this vi...may b this will help you.........
    Attachments:
    Read Excel-1.vi ‏32 KB

  • How to load data from MS Excel file

    Hello All,
    Please help me regarding:
    how to load data/ insert records from MS Excel spreadsheet into Oracle table without converting that MS Excel file into CSV.
    Thank You in advance.

    Vivek More wrote:
    how to load data/ insert records from MS Excel spreadsheet into Oracle table without converting that MS Excel file into CSV.Setup HS connectivity:
    1. Create ODBC SYSTEM DSN using Microsift Excel driver(xls) and select your excel file as workbook.
    2. Create file initXLS.ora in %ORACLE_HOME%\hs\admin directory contailing the following line:
    HS_FDS_CONNECT_INFO = XLS3. Modify listener.ora file in %ORACLE_HOME%\network\admin directory and add the following lines to SID_LIST under SID_LIST_LISTENER
        (SID_DESC =
          (SID_NAME = XLS)
          (ORACLE_HOME = your-oracle-home)
          (PROGRAM = hsodbc)
        )4. Modify tnsnames.ora file in %ORACLE_HOME%\network\admin directory and add the following lines:
    XLS =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SID = XLS)
        (HS=OK)
      )5. Restart listener.
    6. Create database link (public or private depending on your needs):
    CREATE PUBLIC DATABASE LINK XLS USING 'XLS';7. Now you are all set. For example my file has:
    NAME
    SAM
    JOEDefault sheet name "Sheet1$" is treated as table name (Since excel is case sensitive you need to use quoted name). First row is treated as column name. And select:
    SQL> select * from "Sheet1$"@xls;
    NAME
    SAM
    JOE
    SQL> Now if you do not know excel sheet names you can issue (I renamed excel sheet Sheet1$ to Names$):
    SQL> select table_name from all_tables@xls;
    TABLE_NAME
    Names$
    Sheet2$
    Sheet3$
    SQL> select column_name from all_tab_columns@xls where table_name = 'Names$';
    COLUMN_NAME
    NAME
    SQL> SY.

  • How to read data from a .txt file?

    currently i'm under study on java
    while need to extract data from a hyperterminal or .txt file
    could any one help me in this problem.?
    as in txt or .ht got their own overhead .( or what u call it. tt identify the file type)
    so how to open it and read data one ah?
    thanks all.

    Here's a code snippet 4 u
    String sInput = null;
    FileInputStream sStream = new FileInputStream("yourTxtFile");
    BufferedReader fileIn = new BufferedReader(new InputStreamReader(sStream));
    while((sInput = fileIn.readLine()) != null){
    System.out.println(sInput);
    hope this help
    *-)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to read data from a .txt file in real time

    Hi
    I am running a fortran code which takes around 1 week to run and output data are continuously saved in .txt files. I want to display these data and plot it against time in labview.
    Lets say I have a array of real numbers starting from 1.0 , and every 2-3 sec another number is added (output of code). So I dont want end-of-file-reached error in my program and also want program to wait until next data is updated in .txt file.
    I tried to make a simple read_txt_file.vi, but I am getting problems in terms of continous reading. Help !! Help !!
    Pl see the attached vi.
    Thanx
    PKJ
    Attachments:
    FileReader.vi ‏43 KB
    labview.txt ‏18 KB

    Hi PKJ,
          I modified your VI and it seems to do what you asked, that is, display the data from a file as the data is being added.
    Hope it helps!
    Message Edited by Dynamik on 11-08-2005 04:32 PM
    Message Edited by Dynamik on 11-08-2005 04:34 PM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    FileReader.vi ‏52 KB

  • How to read data from the PDF file

    Hi
    i need pdf related API details and sample program to retrive the data from the pdf.

    Did you even try looking this one up yourself? Google "java pdf" and you get plenty of results. The first one looks pretty promising, and I'm sure there is plenty of documentation with the API.

  • How to read data from an excel using abap program?

    Hi
    I have to write an abap program to read the contents of ms excel across various
    sheets. Can any one help me regarding this
    Thanks in advance
    Satish

    Hai Satish,
    <b>You save  all your Excel sheets as Text Tab Delimited.</b>
    And then for each teext file can be uploaded into your daabase table.
    See the Report that  i have done.
    REPORT Z_UPLOAD_TO_DATABASE_TABLE.
    TABLES:
      ZDETMAST.                        " Database table to be uploaded
    Data declaration of the structure to hold ZDETMAST(zdetcode) data  *
    DATA:
      BEGIN OF FS_ZDETMAST,
        CNT(3)      TYPE C,                " Client
        DETCODE(15) TYPE C,                " Det Code
        DETCAT(1)   TYPE C,                " Det category
        DETTYPE(2) TYPE  N,                " Det type
        DETDESC(30) TYPE C,                " Det description
        PFLAG(1)   TYPE C,                " Det Flag
        TOTALDR(10) TYPE C,                " Total DR
        TOTALCR(10) TYPE C,                " Total CR
      END OF FS_ZDETMAST.
    Internal table to hold ZDETMAST(zdetcode) data                     *
    DATA:
      T_ZDETMAST LIKE STANDARD TABLE OF FS_ZDETMAST.
    Function Module to upload ZDETMAST Data
    CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
         FILENAME                      = 'D:/ZDETMAST_2.TXT'
         FILETYPE                      = 'ASC'
         HAS_FIELD_SEPARATOR           = 'X'
        HEADER_LENGTH                 = 0
        READ_BY_LINE                  = 'X'
        DAT_MODE                      = 'DAT'
        CODEPAGE                      = ' '
        IGNORE_CERR                   = ABAP_TRUE
        REPLACEMENT                   = '#'
        CHECK_BOM                     = ' '
        VIRUS_SCAN_PROFILE            =
      IMPORTING
        FILELENGTH                    =
        HEADER                        =
        TABLES
          DATA_TAB                      = T_ZDETMAST
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         FILE_READ_ERROR               = 2
         NO_BATCH                      = 3
         GUI_REFUSE_FILETRANSFER       = 4
         INVALID_TYPE                  = 5
         NO_AUTHORITY                  = 6
         UNKNOWN_ERROR                 = 7
         BAD_DATA_FORMAT               = 8
         HEADER_NOT_ALLOWED            = 9
         SEPARATOR_NOT_ALLOWED         = 10
         HEADER_TOO_LONG               = 11
         UNKNOWN_DP_ERROR              = 12
         ACCESS_DENIED                 = 13
         DP_OUT_OF_MEMORY              = 14
         DISK_FULL                     = 15
         DP_TIMEOUT                    = 16
         OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.                                 " IF SY-SUBRC <> 0.
    LOOP AT T_ZDETMAST INTO FS_ZDETMAST.
      WRITE:
        / FS_ZDETMAST-CNT,
         FS_ZDETMAST-DETCODE,
         FS_ZDETMAST-DETCAT,
         FS_ZDETMAST-DETTYPE,
         FS_ZDETMAST-DETDESC,
         FS_ZDETMAST-PFLAG,
         FS_ZDETMAST-TOTALDR,
         FS_ZDETMAST-TOTALCR.
    ENDLOOP.                               " LOOP AT T_ZDETMAST ...
    LOOP AT  T_ZDETMAST INTO ZDETMAST.
       IF SY-TABIX GE 2.
         INSERT ZDETMAST.
        DELETE ZDETMAST.
       ENDIF.                              " IF SY-TABIX EQ 2
    ENDLOOP.                               " LOOP AT  T_ZDETMAST
    Hope this helps you a lot.
    <b>You can also use ALSM_EXCEL_TO_INTERNAL_TABLE FM to have excel data in ITAB AND THEN YOU CAN INSERT DATA INTO DATABASE TABLE.</b>
    <b>Reward points if it helps you.</b>
    Regds,
    Rama chary.Pammi

  • How to read data from an word file

    Hi to all experts.
    My requirement is to read a word file and convert it to a text file.How to do it?

    Try the following code.
    When u execute the following code it will ask u to browse to the "word Document' u wanna read.
    PARAMETERS: p_path   LIKE rlgrap-filename.
    data :lv_filename type string.
    data : itab type TABLE OF string.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path .
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          file_name = p_path.
      IF sy-subrc <> 0.
        MESSAGE 'Error getting File Information' TYPE 'S'.
      ENDIF.
    START-OF-SELECTION.
            lv_filename =  p_path.
          CALL FUNCTION 'GUI_UPLOAD'
            EXPORTING
            filename                = lv_filename
            filetype                = 'ASC'
            read_by_line            = 'X'
          TABLES
            data_tab                = itab
          EXCEPTIONS
            file_open_error         = 1
            file_read_error         = 2
            no_batch                = 3
            gui_refuse_filetransfer = 4
            invalid_type            = 5
            no_authority            = 6
            unknown_error           = 7
            bad_data_format         = 8
            header_not_allowed      = 9
            separator_not_allowed   = 10
            header_too_long         = 11
            unknown_dp_error        = 12
            access_denied           = 13
            dp_out_of_memory        = 14
            disk_full               = 15
            dp_timeout              = 16
            OTHERS                  = 17.
        IF sy-subrc <> 0.
          MESSAGE 'ERROR UPLOADING DATA' TYPE 'E'.
        ENDIF.
    I thing it should work.

  • How to read data from a text file

    I have saved a text file on my hard drive, and would like to read the file. Once read I would like to copy it to another file. I think I am suppose to use the BufferedReader, and FileReader classes. I am not sure what sequence to follow in order to do this. Could some one give me some feed back on what is needed, and in what sequence to perform this task?

    Where do I store my file within my Platform(Eclipe), in order to read or access the file. Whenever I use the declaration below. I get an FileNotFoundException. I understand the code, but am not sure where to store the file, so that the line of code below will recognize it..
    FileReader in = new FileReader("data1.txt");
              BufferedReader a = new BufferedReader(in);

  • How to read data from a file that was formatted by excel?

    Hi everyone, I'm familiar with java.io and the ability to read from files, can anyone tell me how to read data from a file that was formatted by excel? Or at least give me some web references so that I can learn about it?

    http://jakarta.apache.org/poi/hssf/index.html
    HSSF stands for Horrible Spreadsheet Format, but it still works!

Maybe you are looking for

  • Sept. 10 - No Phone Service still reported Aug 30 Medical Emergency

    My parents are in their 90's and Mom is blind. We reported their outage on 8/30.  It was marked a Medical Emergency and were promised that the repair would be highest priority  - what a joke!!!!   We were told and texted that the repair would happen

  • Problem for Sound Format.

    Hi, I have developed a Game and it uses the .wav file works very well in Emulator. I sent that game to Game distributor, This is the reply i got. We found no problem to implement into Device and it works properly except with NO sound Game use "wav" f

  • Can't move ANY documents or folders in the Finder!

    Please help... I have 10.5.1, luckily, when logged in as myself as a user the computer operates normally, when logged in as my wife she (or I) cannot move any document or folder ANYWHERE not on the desktop, from a flash drive, from any folder... I ev

  • Intrastat cross-company

    Dear people, I have a question about intrastat. Now we have this business case. I have created sales organization SOCZ with czech UID and tax registration in CZ assigned to company code CCSK in country SK. Now we are using cross-company process: - sa

  • No Audio with videios in iPod

    I followed all the steps in making a video able to play on my iPod. I had it in ituns but it has no audio. whats wrong?