sab
sab

Reputation: 9977

How to read excel file and convert it to tab delimited file with java

I have a directory where files are constantly updated. I need to read the latest excel file and convert it into tab delimited file. It is under windows. A batch + java solution will work for me. Or if I can use excel in command line programatically that also works

Upvotes: 1

Views: 4337

Answers (6)

duffymo
duffymo

Reputation: 308763

I would disagree with those people who recommend Apache POI. The best API that I know of for dealing with Excel is Andy Khan's JExcel.

Upvotes: 1

iggymoran
iggymoran

Reputation: 4089

It has already been widely suggested, POI is probably the most complete "pure Java" implementation of Excel.

In one API you get support for Excel 2003 and 2007.

However, you need to be weary of its memory footprint. It is a hog. If you use it, make sure you use the event-driven model it supports as this will reduce footprint and execute faster.

Upvotes: 1

irishbuzz
irishbuzz

Reputation: 2460

You can use Apache POI API for reading the excel file and OpenCSV for writing the CSV file.

Upvotes: -1

Michał Niklas
Michał Niklas

Reputation: 54302

Have a look at other SQ question: convert Excel to csv either using shell script or jython . if so how

I answered with PyODConverter, but there is jodconverter: Java version of this tool. It uses OpenOffice working as a service. I use it to convert between various file formats.

Upvotes: 0

stark
stark

Reputation: 839

You can read in the excel sheet using POI and then iterate through the cells, writing them out to a separate file with appropriate delimiters.

Upvotes: 0

Andriy Sholokh
Andriy Sholokh

Reputation: 872

In Java you can use, for example, Apache POI library to read data from Excel files. And then use standard Java facilities to write data into tab delimited file.

Upvotes: 0

Related Questions