• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CSV - Difficulty in having the delimiter recognized

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make your life easy and get the Ostermiller utilities at http://ostermiller.org/utils/.
This includes a class for creating CSV files that are compatible with Excel.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic