Hi,
The below awk script is taking about 1 hour to fetch just 11 records(columns). There are about 48000 records. The script file name is take_first_uniq.sh
Code:
#!/bin/ksh
if [ $# -eq 2 ]
then
while read line
do
first=`echo $line | awk -F"|" '{print $1$2$3}'`
while read line2
do
second=`echo $line2 | awk -F"|" '{print $7$13$14}'`
if [ ${first} == ${second} ]
then
echo $line2
fi
done < $2
done < $1
fi
I call this script this way..
Code:
ksh take_first_uniq.sh file_3uniq_fields.out file_sort_all_fields.out > file_uniq_master.out
Please suggest me how to increase the performance.. I'm new to awk scripting.
Thanks,
RRVARMA