Quote:
|
Originally Posted by djt0506
hi all.
im using the awk command to search a file for a matching number.
lets say the numbers in the file are 4588281, 4588282 and 4588283.
my problem is when i search for 8, the three numbers above appear. I want to have it so that if i search for any number that is not matching EXACTLY THE SAME as the three numbers above, then nothing will be returned from the awk command.
is there a way to do this? if so, how?
thanks all in advance for your replies.
|
try this ..
in grep
Code:
egrep -v '4588281|4588282|4588283' test
in awk
Code:
awk '$0 !~ /4588281/ && $0 !~ /4588282/ && $0 !~ /4588283/ { print $0 }' test