Question : Anyway to search a large text file without loading it into memory?

Say I wanted to get line 150,000 of a HUGE text file and store it into a string... is there anyway to do this without loading the entire file into memory?

Thanks

Answer : Anyway to search a large text file without loading it into memory?

File are sequential so unless the lines are FIXED WIDTH in length and you can calculate the byte offset of XXX line number, then your only option is to COUNT line by line one at a time or by reading in "chunks" and splitting on carriage return/line feed.  Either option still requires you to physically count the lines until you reach the target.
Random Solutions  
 
programming4us programming4us