Parse tags into arrays | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Parse tags into arrays

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-15-2013
sinpeak sinpeak is offline
Users Awaiting Email Confirmation
 
Join Date: Dec 2008
Last Activity: 17 April 2014, 2:16 AM EDT
Posts: 26
Thanks: 1
Thanked 1 Time in 1 Post
Parse tags into arrays

Hello,

I am writing a PERL code. The code is given a file which has data in the format of :


Code:
<Tag Name> <Tag value>

e.g. :


Code:
FIRSTNAME DAVID

Now, the file to be processed by the PERL code has data something like this :


Code:
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.

Last edited by Scrutinizer; 01-15-2013 at 08:54 AM.. Reason: code tags
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How can I use the arrays ? dnam9917 Shell Programming and Scripting 1 09-06-2011 12:12 AM
question about int arrays and file pointer arrays omega666 Programming 1 03-16-2011 01:15 AM
arrays how to? vlopez UNIX for Dummies Questions & Answers 1 04-28-2009 10:49 AM
PHP arrays in arrays JerryHone Web Programming 3 03-13-2009 03:19 PM
Arrays earlysame55 Shell Programming and Scripting 2 11-06-2008 03:02 AM



All times are GMT -4. The time now is 01:14 AM.