Re: Deleting contents of file



On Thu, 28 Feb 2008 04:12:26 -0800 (PST),
christopher_board@xxxxxxxxxxx wrote, quoted or indirectly quoted
someone who said :

I am currently devloping a java application where the application when
it is launched reads in a CSV file and then populates that data into a
JList. I would like the user to be able to select an item from the
JList and then click a button which deletes the row that item is in
within the CSV file. How would I go about doing this.

Another approach is to read the whole file into RAM as a String.
Fiddle it as you please. Write out the entire file to a temp. When it
succeeds, delete the original and rename the temp to the original.

For sample code see http://mindprod.com/products1.html#COMPACTOR

--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.