views:

299

answers:

2

Is there a programmatic solution to this that does not involve having Office on the server?

Update: This solution will be deployed in a .Net shop, so for now PHP and Java approaches aren't on the table (though I was impressed with the libraries themselves).

We will be receiving documents in csv, .xls, and .xlsx formats that need to be parsed and their data shoved into a DB. We're planning on using the OpenXML SDK for all of the parsing goodness and want to operate over only one file type.

+2  A: 

You can achieve this using the Apache POI library for Java.

HSSF is the POI Project's pure Java implementation of the Excel '97(-2007) file format.

XSSF is the POI Project's pure Java implementation of the Excel 2007 OOXML (.xlsx) file format.

I've used it to read in a complete mix of .xls and .xlsx files, and I always output .xlsx.

For .csv files, import using the Super CSV library and export using the Apache POI library above.

The main motivation for Super Csv is to be the best, fastest and most programmer friendly free CSV package for Java.

Dolph
+1  A: 

Or use PHPExcel ( http://www.phpexcel.net ) if you want a PHP solution rather than java

Mark Baker