Using wildcard in awk programming, how ?
Hi people,
I have statement awk ' { if(( $9=90*) && ($9=91*) && ($9=92*)) print $9 }'> /home/some_file.txt where with * I want to select all numbers which begin with 90, 91, 92, and no mater which number is later. There is 4 numbers after 90, 91, 92. how use wild wildcards in this case to print out all that numbers. Thanks |
Hi,
Is this what you want: awk '$9 ~ /^9[0-2]/ { print $9 }' infile > outfile This checks to see if field 9 starts (^) with a 9, followed by 0,1 or 2 ([0-2]). If this is the case field 9 is printed, no matter what else is after ^9[0-2]. Hope this helps. |
Quote:
Regards |
All times are GMT -5. The time now is 06:48 PM. |