• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

writing data to CSV file

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

My task is to write data to csv file after parsing data from Log file.

By using DataInputStream i am able to parse the data in the Log file and now how i can write parsed data to CSV file?
Please see the below code:


regards,
rama
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you know what a CSV file looks like internally? If so, what would you have to do in order to create such a file?

Of course, if you have just a single value in each row, then there isn't much difference between a non.CSV text file and a CSV file.

Lastly, if the data that's supposed to go into the CSV gets more complicated, then you should consider using a library for creating such files - the format does get more complicated to generate if you can't make any assumptions about its contents. The AccessingFileFormats page links to several available CSV libraries.
 
Oh sure, it's a tiny ad, but under the right circumstances, it gets bigger.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic