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 I/O and Streams and the fly likes CSV - Difficulty in having the delimiter recognized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "CSV - Difficulty in having the delimiter recognized" Watch "CSV - Difficulty in having the delimiter recognized" New topic

CSV - Difficulty in having the delimiter recognized

Monty Guppy
Ranch Hand

Joined: Sep 15, 2001
Posts: 49
I have a text file which contains several records of data. Some of the fields in the data contain comma. So I have tried the following by using either of tab(/t), semi-colon( , and pipe(|) as a delimiter.
I then upload this text file as a bytearray to the database, and use a servlet to download the data in a CSV format. The data gets downloaded correctly, but to my dismay, Excel always uses comma as a delimiter (thus slicing my field data in the middle), while ignoring any of the above delimiters to separate out fields.
Of course, I can use the machinations of Excel to separate out the data with the right delimiter, but my users may not know how to do so.
Can anyone please let me know what to do about this.
Thank You.
David G Risner
Ranch Hand

Joined: May 02, 2002
Posts: 30
Make your life easy and get the Ostermiller utilities at
This includes a class for creating CSV files that are compatible with Excel.

David G. Risner<br />Software Engineer<br />California State University, Los Angeles
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: CSV - Difficulty in having the delimiter recognized
It's not a secret anymore!