Would like to read and compare first field from two files then print 

1. Match Lines from Both the files - ( Available in f11.txt and f22.txt) -> Op\_Match.txt
2. Non- Match Lines from f11.txt ( Available in f11.txt Not-Available in f22.txt)-> Op\_NonMatch\_f11.txt
3. Non- Match Lines from f22.txt ( Available in f22.txt Not-Available in f11.txt)-> Op\_NonMatch\_f22.txt

Using below 3 separate commands to achieve the above scenario's . 

f11.txt

```
10,03-APR-14,abc
20,02-JUL-13,def
10,19-FEB-14,abc
20,02-AUG-13,def
10,22-JAN-07,abc
10,29-JUN-07,abc
40,11-SEP-13,ghi

```

f22.txt

```
50,DL,3000~4332,ABC~XYZ
10,DL,5000~2503,ABC~XYZ
30,AL,2000~2800,DEF~PQZ

```

To Match Lines from Both the files:

```
awk ' BEGIN {FS = OFS = ","} FNR==NR {a[$1] = $0; next} ($1 in a) {print $0,a[$1]}'   f22.txt f11.txt> Op_Match.txt

10,03-APR-14,abc,10,DL,5000~2503,ABC~XYZ
10,19-FEB-14,abc,10,DL,5000~2503,ABC~XYZ
10,22-JAN-07,abc,10,DL,5000~2503,ABC~XYZ
10,29-JUN-07,abc,10,DL,5000~2503,ABC~XYZ

```

To Non- Match Lines from f11.txt:

```
awk ' BEGIN {FS = OFS = ","} FNR==NR {a[$1] = $0; next} !($1 in a) {print $0}'   f22.txt f11.txt > Op_NonMatch_f11.txt

20,02-JUL-13,def
20,02-AUG-13,def
40,11-SEP-13,ghi

```

To Non- Match Lines from f22.txt:

```
awk ' BEGIN {FS = OFS = ","} FNR==NR {a[$1] = $0; next} !($1 in a) {print $0}'   f11.txt f22.txt > Op_NonMatch_f22.txt

50,DL,3000~4332,ABC~XYZ
30,AL,2000~2800,DEF~PQZ

```

Using above 3 separate commands to achieve the mentioned scenario’s. Is there any simplest way to avoid 3 different commands? Any Suggestions ...!!!