Hello,
I have a data in file 1
2000000024776
2000000026979
2000000033355
2000000036309
2000000041291
2000000042679
2000000067221
and in file 2 its like this
2000000024776 16
2000000026979 16
2000000033355 16
2000000036309 16
2000000041291 16
2000000042679 16
2000000067221 16
2000000117968 13
2000000120830 14
2000000120897 13
2000000121192 14
2000000123529 17
2000000125318 17
2000000128635 8
output is
2000000024776 16
2000000026979 16
2000000033355 16
2000000036309 16
2000000036309 16
2000000036309 16
2000000041291 16
2000000042679 16
2000000067221 16
I am searching for data of file file and printing it using below script but its slow
while read line1
do
echo "$line1"
a=`echo $line1|cut -c 1`
if [ $a -ge 0 ]
then
num=`echo "$line1"|cut -c 1-13`
echo "$num"
cat file3.csv |nawk -v "c=$num" '$1 ~ c' >> new_file.csv
fi
done < file4.csv