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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get the line number of every occurrence of a string in an ASCII file.

Status
Not open for further replies.

tbtcust

Programmer
Oct 26, 2004
214
US
How do I get the line number of every occurrence of a string in an ASCII text file with minimal reads and counting each line?

I have an ASCII text file with close to 8 million records in it. I need to scan the file and provide the line number for every occurrence of a string.

Thanks in advance for any help.
 
Or maybe not :)



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top