How to Query XL Workbook From Unix

Querying a Microsoft Excel document from a Unix shell command line operating system can be an efficient way to retrieve data stored on your network without having to go through the trouble of converting the Excel spreadsheet to a different file format that's Unix-compatible. Using Oracle's Open Database Connectivity, or ODBC, you can query an Excel spreadsheet or workbook directly from a Unix command line.

Instructions

    • 1

      Open your Unix command line and enter the following command to load the Excel file. Replace "exampledata.xls" with the directory path and file name that you actually need to query:

      load data local infile 'exampledata.xls' into table my_table

    • 2

      Enter the following command to separate the fields in the Excel file with commas:

      fields terminated by ','

    • 3

      Enclose the data fields in quotations by using the following command:

      enclosed by '"'

    • 4

      Enter the following command to terminate each line of the Excel file with "\n":

      lines terminated by '\n'

Related Searches:

References

Comments

Related Ads

Featured