Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello Magnanimous Monks, I am attempting to rewrite some Bash scripts that use a lot of awk pipes into Perl. I am looking for the best way to read in information from a repetitive text file. The text file looks something like this:
etc... And then the "pattern" repeats (many times) in the text file. The end result is to print it all out in neat columns with headers at the top, something like:
I started out putting the whole text into an array and grepping out what I want, put that was quickly becoming very messy. My second attempt is trying to extract multiple lines using the method:
I found my self wanting to then put it into an array as above but that will most likely end up being the same messy situation. I would greatly appreciate any ideas or suggestions about an easy way to extract the bits of info that I want and print them out into the desire column format (using sprintf I reckon). Also as a side note, the Perl will need to be somewhat portable (i.e. it'll run under Windows, Linux, and OSX OS's). Thanks in advance! In reply to Extracting and manipulating a range of lines by joeymac
|
|