how to write a csv file using javaCSV

10 views
Skip to first unread message

Michealjalls

unread,
Jul 23, 2009, 2:33:15 AM7/23/09
to CSVChat
hi all
i m just new to javaCSV
i know how to read a javaCSV file
but i want to know how to write CSV file using javaCSV
so please help to guide or if u have any code guidence
telle me
Regards
Michealjalls

shriop

unread,
Jul 23, 2009, 2:41:34 AM7/23/09
to CSVChat
Again, bad me and my lack of code samples. The general gist can be
found by looking at this C# code example, http://www.csvreader.com/code/cs/xml_to_csv.php
. All of the method signatures are basically the same, just with
capitalization differences. You just pass in a file name into the
constructor, call write as many times as you have values for a
particular row, then call endRecord. You do that for as many records
as you have. You then call close. Just make sure you don't try to
check the contents of the file before the close is actually called
because many people have mistakenly reported this as a bug that the
data isn't written to the file because they didn't realize that the
writer buffers. There's other constructor overloads and settings that
can be set, but writing a simple csv file is pretty simple.

Bruce Dunwiddie
Reply all
Reply to author
Forward
0 new messages