This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Create .csv from .xls" Watch "Create .csv from .xls" New topic
Author

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.
Thanks
Carol Enderlin
drifter
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Create .csv from .xls
 
Similar Threads
JSP-EXCEL save defualt in .xls extension, open excel with in the browser
Download it in different sheets in Excel
Problem in Export to Excel using Jexcel api
Jsp to Excel
creating a text file from JSP