I have a requirement to separate only some numbers from the input file and produce it in a format.
The input is ( i have took a sample, the actual file contains more than 50000 rows around 840 MB in size)
$cat temp.txt
001 08 002 08 003 06 004 11 005 11 006 08
007 08 008 92* 009 92 010 92 011 92 012 92
013 92 014 92 015 92 016 92 017 92* 018 92
I use the script like below
awk '{for(i=1;i<=NF;i=i+2) {x =i+1; print $i,$x ; print "\n";}}' temp.txt | awk '/*/ {print "substr($2,1,2), $1}'
The output is
92 008
92 017
Could you please tune my script which will have only one awk or some other commands. Appriciate your help on this.
Thanks
Senthil ak.