And requires its ouput in following format
prn|pri|rg|pre|prec|pra|filter|uri|pid|dpl|fs|daddr|prec
If you could help me on this.
thanks
---------- Post updated at 06:23 PM ---------- Previous update was at 06:21 PM ----------
Below is the code I used to make the script for the previous one
#!/bin/sh
for i in 1 2
do
while read line
do
a=`echo $line | awk '{printf $1}'`
b=`echo $line | awk '{printf $3}'`
if [ "$a" == "name" ]
then
c1=$b;
fi;
if [ "$a" == "address" ]
then
c2=$b;
fi;
if [ "$a" == "phone" ]
then
c3=$b;
fi;
done <file$i.txt #echo $c1 $c2 $c3
while read line
do
a=`echo $line | awk '{printf $1}'`
b=`echo $line | awk '{printf $3}'`
for (( l=1 ; l<=1 ; l++ ))
do
if [ "$a" == "item" ]
then
e[$l]=$b;
printf "\n"$c1"|"$c2"|"$c3"|"${e[$l]}"|";
fi;
if [ "$a" == "type" ]
then
f[$l]=$b;
printf ${f[$l]}"|";
fi;
if [ "$a" == "count" ]
then
d[$l]=$b;
printf ${d[$l]}"|";
fi; #if [ "$a" == "type" ] #then #f[$l]=$b; #printf ${f[$l]}"|"; #fi;
done
done <file$i.txt
printf "\n";
done