I need to consolidate 2 records of data into 1 record.
here is a sample of the input:
------------------------------------------------------------------------------------------
totalcount fred thomas 99999.00 88888:00
total 77777.00
------------------------------------------------------------------------------------------
totalcount sally smither 99999.00 88888:00
total 77777.00 66666.00
------------------------------------------------------------------------------------------
Sample records are grouped within the '-------'. I need the data within the '---------' consolidated to look like the output format below
I am attempting to read/learn about the important parts of that script/command. Is is a true statement that awk considers everthing between the record seperator RS as one record?
Wow clean and simple.
Again thank you and regrards,
T
I've sat at the beginning of Eau Rouge. That circuit is in a magical place.
#!/usr/bin/ksh93
typeset -L1 -u firstF
typeset -L1 -u firstL
while read a b c d e
do
if [[ $a == "totalcount" ]]; then
nameF=$b
nameL=$c
numD=$d
numE=$e
fi
if [[ $a == "total" ]]; then
firstF=$nameF
firstL=$nameL
print "${firstF}${nameF#?}, ${firstL}${nameL#?}, $b, $numD, $numE"
fi
done < file
What is up with the ksh you use? above is the version available on the server i am using... it seems to be a newer version that ksh93... is that correct?