This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Create .csv from .xls Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Create .csv from .xls" Watch "Create .csv from .xls" New topic

Create .csv from .xls

Amber Vaidya
Ranch Hand

Joined: Oct 14, 2003
Posts: 42
We have a requirement to create a .xls and a .csv file from some data.

I was successfully able to create the .xls using Apache POI and download the file on the client side using

Now, to generate the .csv file I changed the above to

The .csv file is created correctly and it opens in MS Excel.

The problem is if I open this .csv file in a text editor, it shows junk.

Can someone please tell me what am I doing wrong ? Something in POI or maybe something while setting the header ?

Don't even know if this is the right forum for this problem

Any help in this regard will be greatly appreciated.
Carol Enderlin
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
POI seems like overkill for csv files, since they ARE just text.
Amber Vaidya
Ranch Hand

Joined: Oct 14, 2003
Posts: 42
Yeah, I thought as much .. but since I am already creating the .xls file (which I need) using POI , I got lazy and decided to check if I can somehow turn the .xls to .csv

Magic ??
Amber Vaidya
Ranch Hand

Joined: Oct 14, 2003
Posts: 42
Finally did it by writing some more code to create a new csv file. :roll:

Deadlines !!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Create .csv from .xls
It's not a secret anymore!