hi;
i have a file containing lines like:
1|1069108123|96393669788|00963215755711|2|0|941||;serv:Pps6aSyria;first:0;bear
i want to extract the second, third and fourth record of each line and store it in a file ";" seperated
this is what i wrote
while read line
do
A_party=`echo $line |awk -F["|"] '{print $3}'`
B_party=`echo $line |awk -F["|"] '{print $4}'`
time=`echo $line |awk -F["|"] '{print $2}'`
echo $A\_party";"$B_party";"$time >> $_outfile
done < $_infile
But the problem is that i am calling three times awk for each line, how can i pass awk variable to the script in order to call awk only one time.
Thanks in advance.