|No such thing as a small change|
seek and process from there onby Anonymous Monk
|on May 30, 2006 at 13:31 UTC||Need Help??|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
How do I process lines in a file from the point where a line contains a certain word ?
I have a file that I wish to process. e.g.
I want to start processing the file where the line begins with "internal name". After this I only want to process the lines that have "need this" in them until end of file. Where "need this" always occurs at the beginning of the line.
I can't use seek because I don't know how many lines will be in the file and at what position the "internal name" first appears.
I tried doing something like this but it doesn't work
This doesn't work because each time round the loop it searches for "internal name".
These are variable length records per line and the file is a variable number of lines long.
Any help appreciated