I have 2 text file named as newport and panel port shown below. My awk command combines two files according to their common line to port.txt. I want also not common lines in the new file described in mypurpose. I couldn't combine awk and if or another |awk command.
awk -F' ' 'FNR==NR{a[$1]=$2; next} {print $1,a[$1]}' newport.txt panelport.txt > port.txt
newport
LTECD11L 444
panelport
ENODEB1513L #
ENODEB1521L #
ENODEB1522L #
ENODEB1532L #
ENODEB1533L #
LTECD11L #
LTECD12L #
LTECD14L #
L650112L #
LTEG211L_1 #
LTEG212L_1 #
NodeB1213L #
NodeB1214L #
ENODEB1612L #
ENODEB1614L #
ENODEB1617L #
NodeB1113L #
NodeB1114L #
BB663011L #
BB663012L #
port
ENODEB1513L
ENODEB1521L
ENODEB1522L
ENODEB1532L
ENODEB1533L
LTECD11L 444
LTECD12L
LTECD14L
L650112L
LTEG211L_1
LTEG212L_1
NodeB1213L
NodeB1214L
ENODEB1612L
ENODEB1614L
ENODEB1617L
NodeB1113L
NodeB1114L
BB663011L
BB663012L
mypurpose
ENODEB1513L #
ENODEB1521L #
ENODEB1522L #
ENODEB1532L #
ENODEB1533L #
LTECD11L 444
LTECD12L #
LTECD14L #
L650112L #
LTEG211L_1 #
LTEG212L_1 #
NodeB1213L #
NodeB1214L #
ENODEB1612L #
ENODEB1614L #
ENODEB1617L #
NodeB1113L #
NodeB1114L #
BB663011L #
BB663012L #
Aucun commentaire:
Enregistrer un commentaire