Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I'm having trouble reading in a certain number of lines to string. Seems my strings are too large and it won't read after a certain number of lines (it just doubles over itself).

Any ideas? I really need the first 4,000 lines of a text file read in.

Any help is much appreciated. Thank you,

Suraci

Edit: I tried specifically telling it to read in those 4000 lines, and I also tried setting a max input number of characters at 1,881,000... still ended up maxing out.
Posted
Updated 5-Nov-10 12:49pm
v2

1 solution

You just asked this...Confused
How to read a specified number of lines in from a file[^][^]

Here is someone else asking somewhat the same on another forum and a very nice generic method is given.

http://stackoverflow.com/questions/398378/get-last-10-lines-of-very-large-text-file-10gb-c[^]

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900