Editing Text File

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

I want to delete the first line of a text file but it seems like a waste to
read in the entire file into memory, remove the line, and then write it out
again. Is there a way in VB.NET to delete the first line without reading in
the entire file and recreating it?
 
Read a line at a time - writing to a different file
then delete the original file
then rename the new file
uses less memory this way - but may be slower because of the reads and
writes
if file is small - read into memory then close, open, then rewrite the file
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top