Read a Column from an Excel file

Guys,
Is there a way I can read a specific column from an excel file, use that data to query and select data from a table and then insert the output into another column of that same excel file.
Please advise! Thanks

> Is there a way I can read a specific column from an excel file, use that data to query and select data from a
table and then insert the output into another column of that same excel file.
Not easily. An Excel file is typically in a proprietary binary file format. Perhaps saved using the new MS Office XML format.. which would be possible to process via Oracle's XDB.
But assuming it is in a binary format, you need "something else" to read and parse that file for you - like ODBC or DDE or COM/DCOM, etc.
Oracle supports Heterogeneous Database Services. On a Windows Server, you can create a database link in Oracle that uses an ODBC driver to connect to an ODBC data source. There are ODBC drivers for Excel. However, this requires the data in the worksheet to be properly marked as a data table. Or did last time I looked at it about 2 years ago.
You can also call external "interfaces" from PL/SQL using EXTPROC - such interfaces can be DLLs. Which means you do have access to the Win32 API and application APIs from PL/SQL. This can be used to access the content of an Excel file - DDE for example can quite easily do this (you use it to peek the contents of an Excel grid location), but requires Excel to be running and that spreadsheet to be loaded. DDE can also be used to poke contents (write something back to a cell in a spreadsheet).
But using Oracle code to use an Excel file as a kind of database file... that IMO does not make a lot of sense. At all.

Similar Messages

  • Read all cells from an Excel file?

    Hi!
    I'm trying to read every cell from an Excel spreadsheet file, e.g.
    test.xls. The example in the NI Dev Zone (ActiveX Read Cells from
    Excel2000 VI) works if you know in advance what the first and last cell
    are, e.g. A1 and E453.
    The trouble is that the number of rows & columns in the file will vary;
    the last cell of 1 file might be E453, another might end at F29.
    How can I programmatically read every cell in the file? I thought of 2
    approaches:
    1: Find an ActiveX property that returns the last cell (or last row and
    last column).
    2: Use some other way to read an .xls file, maybe not by launching Excel
    but by using another program ...
    The NI applications engineer couldn't find a reasonably easy solution,
    so I'd w
    elcome any input.
    Thanks! Mark

    Mark,
    I haven't been able to find out if there is an ActiveX property or method the excel exposes to be able to do this ... searching on http://msdn.microsoft.com didn't return anything particularly useful.
    I've tried this sort of thing a couple of different ways. The simplest is if I have control over the file generation code, in that case I've just used the first row A1 and B1 to contain the number or rows and columns respectively and moved on from there.
    If that isn't a possibility then you could enter nonsense data around the acutal data and then look for that and then resize the array. This could get pretty slow if you read row by row, I've somtimes read chuncks of rows and then adjusted the next read and and combined arrays. With a large data set the memory and s
    peed implications do need to be looked at.
    The last thing is what you are referring to in 2. You should be able to save the .xls file as a comma delimited file. In this case the "Read for Spreadsheet File" vi should be able to just read all the data in. I'm not sure how easy it is to export an .xls file to a comma delimited format programatically.
    I think this should work all though I haven't tried it. If it doesn't then you could just read one row and then count the number of commas to determine the number of columns. You can then read the entire file and convert the data into an array, as every comma would separate each column and a carriage return would seperate each row.
    Haven't got LabVIEW on this machine so if I find anything new tomorrow I'll post again.
    Kamran

  • Is there any way to read the data from an excel file w/o using a loop structure?

    I am retrieving a large amount of data (multiple sheets) from an excel file and would like to extract the entire range without retrieving individual cell values(too slow). I can write an range all at once but cannot read it.

    If you are able to write a block of data, then you should be able to read a block. The four requirements that you want to verify are:
    1. The Range specified must match the exact size and location of the data block you want to read
    2. The returned data is in a 2D array of Variants (either strings or numbers)
    3. Use Variant to Data to convert to 2D DBL or 2D Strings
    4. Check for the correct orientation for your application (use transpose if it is not)
    Michael Munroe
    Certified LabVIEW Developer
    www.abcdef.biz
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • How can i Read the Data from such Excel files?

    Dear All,
            Here I am attaching an excel file in which all the datat cells have more than one data, can anybody tell me, how to read from such kind of excel files?
    Thanks in Advance & Happy New Year,
    Rujuta

    Greetings Ruju,
    Here is what I do to read such a file:
    I first save the Excel file (xls) as CSV file (which is easier to handle: Comma Seperated Values) .. Open the file using Excel and save it CSV.
    Then using the code attached I get all these values in a string array.
    Hope this helps
    Ayman Mohammad Metwally
    Automation Engineer
    Egypt - Cairo
    Attachments:
    CSV2ARRAY.vi ‏29 KB

  • How to read the data from an excel file into MYSQL by java language

    Hi all,
    I have some data in excel spread sheet and I want to put the data into MYSQL data base. I created the tables in MYSQL> How can I write a program in JAVA that puts the value from excel sheet to mysql??
    I would appreciate your help
    regards

    By typing code at the keyboard... but presumably you meant to ask what code you should type.
    To get data out of Excel there are a few alternatives. The Google keywords I would use to find them are "java excel". I use Apache POI but there are other possibilities, I believe. As for getting the data into MySQL once you have extracted it from Excel, you would use JDBC. But you already knew that, didn't you? You did find the JDBC forum.
    In general it's better to ask a specific question on a forum. If you don't have a clue (which is the way we all start out) then just telling people that isn't going to be helpful. The best you're going to get is links to tutorials, which you could perfectly well have found for yourself by simple web searches.

  • Separating values from an excel file and plotting

    Hello,
    I am using the read excel table vi to read the values from an excel file.I see the data in the output.
    I wanted to take the first two columns and multiply each value with 20m and then plot it in a XY graph. 
    I am attaching the files below.
    Thanks in advance 
    Solved!
    Go to Solution.
    Attachments:
    test data.xls ‏436 KB
    ReadExcelTable[1].vi ‏23 KB

    Hello,
    i acheived the multiplication in a different way but i have another problem.I am only considering two columns in the above excel sheet.After multiplying each value with 0.02  i get another array for the two columns with values say a,b,c,d and a1,b1,c1,d1 and so on.
    The plot i require is of (a,a1)   (a+b,a1+b1)  (a+b+c,a1+b1+c1) and so on.
    Any ideas that might help me.I am attaching the VI that solves the problem till multiplication.
    Thanks in advance.
    Attachments:
    INS_plot.vi ‏59 KB
    test data.txt ‏246 KB

  • Reading from an excel file

    I was wondering, what do i need to look at to get cracking with making a programme that can read from a excel file
    I was thinking of making a programme that uses a excel spreadsheet <this spreadsheet is made and provided by the national lottery and has all the winning combinations that have been drawn in past draws> and reading them in and generating a list of combinations that have not occured yet
    Its just for a bit of fun, but could be a good challenege
    thanks

    PaulOckleford wrote:
    If all you want to do is select from the excel sheet you may find it easier to use the jdbc option, I have an example of some code I wrote that does a select from an excel sheet and it may be useful for you:Just my opinion here but I would avoid using odbc to deal with the spreadsheet if at all possible.
    Time for a war story:
    After losing an argument with some business, marketng and management I had to develop a program that accepted spreadsheets as datafiles and it was nothing but trouble.
    I experienced all kinds of type problems, the most common and annoying of them being
    that the driver (via some logic unknown to me) will determine the type of each column.
    Any data that is does not match that expectation is dropped (I found that the query returned NULL).
    As far as I could tell there was no way to make the driver treat the data the way you want it too.
    After much trouble and lots of manual intervention by the poor person who has to deal with this data on a regular basis it seems to be working but it was not fun it is still very ugly code.
    You may not end up reliving my tale of woe, but I though I would give you some fair warning.
    As I continue to say "Spreadsheets are not a reasonable data transfer format."

  • 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

  • Uploading data from a particular column of a particular sheet from an excel file into internal table

    Hi,
    I have to upload data in the first coulmn of 7th sheet of an excel file.
    Can anyone please help me on this.
    This link works perfectly fine for excel files without Macros.
    Read multiple sheets of an Excel file into SAP through ABAP - Code Gallery - SCN Wiki
    But my excel file has some macros.
    And after the macro enable/disable popup is cleared, the system freezes.
    Can someone pease help me on this abd tell me an approach different from the one in the above link?

    Welcome to SCN
    Please search before you post next time:BDC, upload data from multi excel sheets

  • 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

  • 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 read cells from an Excel file?

    Hi,
    I want to search in the first column of a Excel file a name and when I found it I want to read the near cells (same row but different column).
    I try with the Activex but I don't found the rigth solution.
    Can I help me, please?
    Thanks

    Ok, thanks
    Attachments:
    Open & read .zip ‏16 KB
    Find_name subvi.zip ‏28 KB
    Read near cell.zip ‏32 KB

  • 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

  • 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

  • How can I create multiple QR Codes from an Excel File?

    Hi there,
    I am currently trying to set up business cards with a QR Code on the back of each card. Therefore I have an excel spreadsheet, which contains all the data necessary for the business card like name, function, e-mail adress,... the data is then filled in automatically by using the standard function with tags for each column (e.g. table column name is filled in as <<name>> in the specific location on the business card and once executed it is matched with the data from the excel file).
    Is there anything which could help me to automate the personalization of the QR Codes?
    All the best

    For free? Not at the moment. CC does have the ability to create QR codes but only one at a time. In CS6 (perhaps earlier versions?), regular poster/advanced scripter Jongware devised a script to prepare a QR code but again, could only do one at a time.
    However, someone did build on Jongware's QR code to do this from an InDesign file that had the necessary information in tagged text boxes and would prepare QR codes accordingly. However, it would leave them in the InDesign file (e.g. not separate EPS/PDFs).
    So, a long workaround would be:
    install the script and read the thread on the adobe forums (jongware's QR code plus the additional improvement): http://forums.adobe.com/message/4787823#4787823
    data merge the current data into the indesign file using the similar structure as the fourth poster in that post had written
    once all the QR codes are written, create a PDF of the file and then use one of various methods to break up the PDF into single page files: http://colecandoo.wordpress.com/2013/07/13/breaking-up-is-hard-to-do-indesign-files-into-i ndividual-pdfs-that-is/
    It's a lot of work to generate multiple QR codes. A paid solution offered by either Meadows DPS or Woodwing (two companies I have no affiliation with whatsoever) or any other plug-in provider for that matter: http://www.adobe.com/products/indesign/indepth.displayTab3.html may be an alternative that is worth pursuing.

Maybe you are looking for

  • Invalid Credentials: The Network location cannot be reached

    I am working with MDT 2010, and I am getting the error, "Invalid Credentials:  The Network location cannot be reached." When I run the LiteTouch 64 bit, I don't think the network is working.  It's like there is not driver for the network card in the

  • Later - save and manage URLs to be opened later

    later is a small (242 sloc) perl script that saves and manages URLs to be opened later. GitHub repo AUR package (-git) dependencies perl optional dependencies (see -t command-line option) curl perl-html-parser command-line options later [options] [UR

  • Horizontal lines

    This is a new issue, which popped up randomly today, and I can't seem to find any posts that fit the description of what's going on, so here goes: Earlier today, while working on homework, I looked up at my monitor from my textbook and there were sud

  • EMac having issues waking from sleep

    I used to own a 1 gig eMac. I never had an issue with it, now that I have sold it however, it's having this issue waking from sleep. The only way to get it back is to power it down by holding the power button. When I had it, I had Panther running on

  • IFolder 3.8 dirsync created orphaned users

    Had an incident where around 50 of 70 users were deleted from an ifolder slave. The ifolders they had were then orphaned. The next day the users were synced back into ifolder, but the folders had to be associated manually. Any ideas on why this would