Home > OS >  Turn to the great god than Awk file
Turn to the great god than Awk file

Time:11-12

File a

A 1
2 b
3 c
4 d

===========

The file b

2
5
6

=============
The output file of a $2 match to the file b line

The output file a $2 does not match the file b line

CodePudding user response:

Top of a roof, a great god

CodePudding user response:

A ah, don't sink

CodePudding user response:

Interest to have a try, do not know whether meet your requirements:
The output file of a $2 match to the file b line
Awk 'NR==FNR {a [$1]=$1} NR> FNR {the if ($2==[$2) a) print} 'bb aa

The output file of a $2 does not match the file b line
Awk 'NR==FNR {a [$1]=$1} NR> FNR {the if ($2!=[$2) a) print} 'bb aa

CodePudding user response:

reference agpintel reply: 3/f
interest to have a try, don't know whether meet your requirements:
The output file of a $2 match to the file b line
Awk 'NR==FNR {a [$1]=$1} NR> FNR {the if ($2==[$2) a) print} 'bb aa

The output file of a $2 does not match the file b line
Awk 'NR==FNR {a [$1]=$1} NR> FNR {the if ($2!=[$2) a) print} 'bb aa
thank?? That no problem?? And to use
  • Related