By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,955 Members | 1,756 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,955 IT Pros & Developers. It's quick & easy.

Delete the last line of a file?

P: n/a
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?
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Ray Cassick \(home\)" <ra***********@adelphia.net> wrote in news:u9Xh
$z*********@tk2msftngp13.phx.gbl:
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.

Jul 19 '05 #2

P: n/a
Agreed.... But he did not mention that, and I hate to assume :)

"Chris Dunaway" <du******@lunchmeatsbcglobal.net> wrote in message
news:Xn**********************************@207.46.2 48.16...
"Ray Cassick \(home\)" <ra***********@adelphia.net> wrote in news:u9Xh
$z*********@tk2msftngp13.phx.gbl:
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.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.