http://qs321.pair.com?node_id=846122


in reply to Parsing and Modifying a flat file in perl

I can't quite make out how you got the output from the input you provided. Maybe I'm just not seeing something obvious, but the rules that applied to the input to produce the output aren't clear to me. So I'll just offer some links that may be of help to a self-described newbie.

The perlretut Perl regular expression tutorial might be of some help. Also, I'm not sure of how new a newbie you are, but the perlopentut should help you get the file open, if you need that. Once you get the file open you can go through it's contents and use regular expressions to match text based on the rules you provide, and manipulate the text as needed.

Those articles are both at http://perldoc.perl.org - you might find the rest of the site helpful as well if you need a good reference.

Also, depending on where you work/study you might have access to Safari, an online service with electronic copies of a ton of good tech books. The O'Riely Perl books are quite good, and might be helpful. 'Programming Perl' was very useful and sat on my desk for a long time while I was learning Perl.

Sorry I couldn't offer anything more specific. Hopefully those will help.