Aug 9, 2011, 5:50 AM
Post #1 of 3
Text processing from a text file
I'm a very beginner in perl, and I have a (hopefully) simple question:
I have a bunch of large text files, where I try to pick up pieces of information without having to go through them manually.
Example text file:
$file = $ARGV;
open IN, $file;
...to process the files
The information I want to catch is at Line 1, but how I know that is the information I want at Line 1 is at Line 3. So basicly how do I backtrack back to the Line 1 to catch the information I want?
With grep I know I can use grep -B 2, and reprocess the output to pick up the info I want, but I just dont know how to do it in perl.
Any help is greatly appreciated!