http://www.perlmonks.org?node_id=1040541


in reply to Parsing multiple rows of text and converting to columns

If you set $/="" then the <FILE> construct will read in paragraphs, ie blocks of lines separated by empty lines.

Within these paragraphs, you can extract your data with a regular expression. For example, /Findings\|(\d+)\|(.*)>\n(.*)/ would extract the record number, the item description and the value as $1, $2 and $3. You could store them in a hash like this $hash{$1}{$2} = $3 for further processing, sorting and printing.

Replies are listed 'Best First'.
Re^2: Parsing multiple rows of text and converting to columns
by gingeremmie (Initiate) on Jun 25, 2013 at 09:47 UTC
    Thank you everybody, much appreciated, I will go and do some experimenting with the ideas you have given me
    Not sure why I was told to post my code in code tags because I didn't post any code? My code is non existent at the moment hehe! I just posted the raw data I was trying to extract. Should that have been in code tags? I wouldn't have thought so but I'm new to this, so would be grateful if someone could let me know.