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!

How to improve speed of reading a huge file?

Status
Not open for further replies.

lutech

Programmer
Jan 25, 2002
16
CA
I have to get some information by checking whole file line by line. I tried use scriptlike "cat file_name|while read line" to do it, but it takes long time. for example, a 10Mbytes file will take more than 10 minutes.
Is there any better way to reduce the reading time?

Thanks in advance.
 
The question, what are you looking for? You could just write a script to grep out what you want since grep is relatively quick or you could write a PERL script for the processing since this is what PERL was made for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top