Hi,
preface:
- the first field is always empty (before the first delimiter), so I deal with fieldnumbers >1 only.
- a space is a field delimiter (and not just to ignore), a string
|a |b|
has five fields: EMPTY,a,EPMTY,b,EMPTY
case 1) The search string has to be looked up in the second field only
awk -F'[ |]' -v sea='str1 str2 ...' 'BEGIN {
s=split(sea,ars," ") }
{ for(j=1;j<=s;j++) if($2==ars[j]) next }
{print}' inputfile
case 2) If you want to lookup in all fields, enclose the 2nd line with an additional loop, e.g.
{ for(i=NF;i>1;i--) if($i) { for(j=1;j<=s;j++) if($2==ars[j]) next } }
mfG Peter
The Universe is a pretty big place,
it's bigger than anything anyone has ever dreamed of before.
So if it's just us, seems like an awful waste of space, right?
Jodie Foster in "Contact"