I have 3 csv files I'd like to combine. Each file has 3 comma delimited columns.
File 1 has columns a,b,c
File 2 has columns d,e,f
File 3 has columns g,h,i
I'd like to combine the 3 files into a single file of:
a,b,c,e,f,h
Can I use sed to do that?
I could write a console app or script easily enough but I'm attempting to get some sed skills and believe this should be a suitable task?
Or just cut and paste:
paste -d ',' file[123] | cut -d ',' -f 1,2,3,5,6,8
You can do:
paste file[123] | sed 's/\t/,/g' | cut -d',' -f 1,2,3,5,6,8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With