|
-
Apr 21st, 2004, 03:21 PM
#1
Thread Starter
Addicted Member
Read a text file from bottom to top??
I need to read a long text file from the bottom to the top. (ie I need to read the last line first and then the second to last line....etc) Is there any optimized code out there to do this?
Thanks,
Bebandit
-
Apr 21st, 2004, 03:28 PM
#2
I wonder how many charact
HOw big are the text files?
I could think of a few ways to do this... the performance of the chosen method really hinges on what else needs to be done, how big the files are...etc.
You could just you a seekable stream and keep moving back one byte a time...
You could load the contents of a text file into an array using split, then reverse the array...
a host of about 3 other options too...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|