That meant reading the file backwards - or perhaps from the end. I wanted to find something really simple in Java to do it. As much as I looked (FileInputStream, FileReader) etc, it all involved copious amounts of work. Since, I didn't know the length of each line, I couldn't easily go to the end of the file, and set an offset!
Here's one of the examples I found: readingfilebackwards for java.
Here's how I did it in perl:
open FILE "$file";Simplicity simplicity simplicity!
@lines = reverse;
foreach $line(@lines)
{
do something
}
No comments:
Post a Comment