Thank you very much, Jim. I really appreciate it.
Originally posted by Jim Yingst:
To delete a file completely, use File.delete(). The file will no longer exist.
To create a file which exists but has no content (a zero-length file), you can use
new FileOutputStream("filename.txt").close();
(This overwrites any previous file.)
To delete some but not all of the content in a text file, you would probably have to read from the original file, and write to a new file, being careful to only write the parts you want in the new file. Then when done, delete the original file, and rename the new file to the old file name.