I've got a CSV file like
Brand,Type,Color
Porsche,Sport,Red
BMW,Coupe,Blue
I'd like to include quotation marks to have it like:
"Brand","Type","Color"
"Porsche","Sport","Red"
"BMW","Coupe","Blue"
What's the fastest way to do it? I will implement it in a cronjob.
Using sed:
sed -e 's/^\|$/"/g' -e 's/,/","/g' input
This might work for you (GNU sed):
sed -r 's/[^,]+/"&"/g' file
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