Limbic~Region has asked for the wisdom of the Perl Monks concerning the following question:
In the past, this is how I have accomplished it:
The problem is that this is slow and memory intensive depending on how large the record is and how far down is the information I am searching for. I would like to use seek or something to read ignoring everything until I encounter match, read backwards to start of record, and then process the whole record.
Here is an example of what a file would look like:
blank line START OF RECORD LINE 1 INFORMATION I AM LOOKING FOR LINE 3 LINE 4 LINE 5 LINE 6 END OF RECORD blank line START OF RECORD LINE 1 LINE 2 LINE 3 LINE 4 INFORMATION I AM LOOKING FOR LINE 6 END OF RECORD
Any ideas?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Read forward and backward - need help
by gjb (Vicar) on Jan 17, 2003 at 21:00 UTC | |
by Anonymous Monk on Jan 17, 2003 at 22:24 UTC | |
Re: Read forward and backward - need help
by Fletch (Bishop) on Jan 17, 2003 at 20:56 UTC | |
Re: Read forward and backward - need help
by BrowserUk (Patriarch) on Jan 17, 2003 at 21:13 UTC | |
Re: Read forward and backward - need help
by MZSanford (Curate) on Jan 17, 2003 at 20:59 UTC | |
Re: Read forward and backward - need help
by jimc (Sexton) on Jan 17, 2003 at 22:58 UTC |