Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fastest way to remove first line from text file 2

Status
Not open for further replies.

toddman2k

Programmer
Jun 6, 2001
9
US
What is the fastest way to remove the first line from a text file?

The only way I know of would be to open the file using the FileSystem Object and re-write all the lines (minus the first line) to a new file.

There's got to be a better way, right?
 
It works fine for small files, but it's taking TOO long for larger 2MB+ files...

I was hoping there would be some way of doing it faster.

Thanks!
 
The fastest way would be to read in the entire file, remove the first line, then replace the file.

there is a trick to reading in big files though, and it's by using .Read and the file size.

look here for more info:

this should help you out alot.

good luck
leo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top