Reading excel file in Unix through ODBC driver

  • achithu
  • Born
  • Born
  • achithu
  • Posts: 2

Post 3+ Months Ago

Hi,

I have a program in Java running in Windows for reading Excel file.I have created a DSN for the excel file in ODBC datasources and read the contents of the file like reading from a database table using JDBC. I want to port this code in Unix environment. Is there any Odbc driver for Excel in Unix? Any inputs on how to port this into UNix environment is gretaly appreciated.Please reply me back if anyone has a solution and it is very urgent.

THanks a lot for help
Chithra
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

What kind of database?

Generally speaking, you need to export the excel file as a csv file, you can then either load that file directly by logging into your database server and running something like:
Code: [ Select ]
load data local infile 'mydata.csv' into table my_table
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(field1,field2,field3)
  1. load data local infile 'mydata.csv' into table my_table
  2. fields terminated by ','
  3. enclosed by '"'
  4. lines terminated by '\n'
  5. (field1,field2,field3)

Or you can parse the file through some script and load it however you need to.

Note, the query above is generalized and will probably be different for whatever database engine you're using (MySQL, Postgres, Oracle).
  • achithu
  • Born
  • Born
  • achithu
  • Posts: 2

Post 3+ Months Ago

Hi,

Thanks for the suggestion. But I have a constraint of maintaining the excel file in.xls format itself and not convert to csv format.That's the reason I am looking for replicating the same scenario as in Windows(Like creating dsn with odbc and then trying to read).Loading the same into database is not a problem.Is it possible to read the data from excel file itself in Unix without coverting it into csv format?

Thanks in advance
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

http://www.excelparser.com/index.php
This one reads xls files under Linux for 80 bucks.

While this one appears to do it for free, though requires some hand-holding. YMMV.
http://cran.r-project.org/src/contrib/D ... gmisc.html

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 28 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.