laziness, impatience, and hubris | |
PerlMonks |
Parse tags into an arrayby dragotony (Initiate) |
on Jan 15, 2013 at 15:59 UTC ( [id://1013418]=perlquestion: print w/replies, xml ) | Need Help?? |
dragotony has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I am writing a PERL code. The code is given a file which has data in the format of :
<Tag Name> <Tag value> e.g. : FIRSTNAME DAVID Now, the file to be processed by the PERL code has data something like this : TAGSTART FIRSTNAME DAVID LASTNAME RHODES <some other tags> <some other tags> ACCOUNT 1000901 <some other tags> <some other tags> BILLAMOUNT 4200 <some other tags> <some other tags> TAGEND The entire set of tags from TAGSTART through TAGEND are repeated multiple times in a file. The number of times of repetition is not fixed in a file. The PERL code is required to process the file such that we have 1 array of the following pairs : "ACCOUNT" tag value - "BILLAMOUNT" tag value Could please point out any approach that would be the best to achieve this ? Thanks.
Back to
Seekers of Perl Wisdom
|
|