I have a csv file that looks like below
"10.8.70.67","wireless",,"UTY_07_ISD",,26579
"10.8.70.69","wireless",,"RGB_34_FTR",,19780
I want to retrieve first, second and fourth column values (without quotes) and populate into a another csv in the below format.
IP DEVICETYPE DEVICENAME
10.8.70.67 wireless UTY_07_ISD
10.8.70.69 wireless RGB_34_FTR
I have used the below awk command
awk -F ',|,,' '{gsub(/"/,"",$1); gsub(/"/,"",$2); gsub(/"/,"",$3); print $1, $2, $3}' file.csv
and got the below output
10.8.70.67 wireless UTY_07_ISD
10.8.70.69 wireless RGB_34_FTR
please help in assigning headings to each column.
Hi, I am able to get the required output. I just want to add heading to each column.OP has given this comment in my answer's section by which I am thinking that OP may not needed a csv file in output but lets wait for OP to come back here, though I will still say it was too early to make this dupe, once OP confirms about it and dupe link is working fine for him then its certainly a dupe.Hi, I am able to get the required output. I just want to add heading to each column.(for which it doesn't look like correct dupe) if in case OP confirms on tripleee's above comments then will vote to make it dupe, thank you.