File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to write to a csv file ??

 
sanat meher
Greenhorn
Posts: 18
  • 0
  • 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
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • 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
Pie
Posts: 42966
73
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic