Hello all, First post here. I did not notice a previous post to help me down the right path. I am looking to compare a column in a CSV file against another file (which is not a column match one for one) but more or less when a match is made, I would like to append a third column that contains a name to the end of the matching row. For instance:
File 1:
Hostname,Port,Name,Status,VLAN,Duplex,Speed,Type
switch1,gi2/1,trunk,active,1,a-100,full,10g,10GBase-CU 3M
switch1,gi3/1,link to data closet,disabled,2,half,a-1000,No XCVR
etc..
File 2:
VLAN,Name,Status,Ports,Device
1,default,active,gi1/1,switch5
2,voice,active,gi2/1,switch5
etc...
Desired Output File:
Hostname,Port,Name,Status,VLAN,Duplex,Speed,Type,VLAN Name
switch1,gi2/1,trunk,active,1,a-100,full,10g,10GBase-CU 3M,default
switch1,gi3/1,link to data closet,disabled,2,half,a-1000,No XCVR,voice
To condense what Im trying to accomplish, I want to create a third file that will have an additional column that appends the vlan name when a match is made. When a match is not made, NA is fine.
Thanks for any help, I've been struggling with SED and AWK