• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to write to a csv file ??

 
sanat meher
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

Could anyone tell me how to write to a csv file using java.
I am reading the content of a csv file and based on some criteria i m writing to anothor csv file.But i m not able to write the entire content to the new file.
I m just able to write the ist line of the csv.Other lines are not written.Please guide me where to make the change.

The code is like this:



Thanks n regards,
Sanat>
 
Joe Ess
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code does not compile:


So I doubt that this is the code that is giving you problems when you run it.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I generally advise people not to create their own CSV read and write routines - the format is more complicated than it at first appears. The http://faq.javaranch.com/java/AccessingFileFormats page lists several ready-made libraries for this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic