Delete the last line of a file?

  • Thread starter Thread starter Charles
  • Start date Start date
C

Charles

What would be the most efficient (in terms of performance)
possible way of deleting the last line from a text file in
vb.net. Also can I get a count of the number of lines in
the file from anything?
 
You would have to read in the file to count all of it's lines.

Unless, of course, each line was equal in size. Then you could just take
the filesize and divide by the line length to get the number of lines.
 
Agreed.... But he did not mention that, and I hate to assume :)
 

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