I have a csv file containing:
# Director, Movie Title, Year, Comment
Ethan Coen, No Country for Old Men, 2007, none
Ethan Coen, "O Brother, Where Art Thou?", 2000, none
Ethan Coen, The Big Lebowski, 1998, "uncredited (with his brother, Joel)"
I want to change the field separator from "," to "|" but I don't want to change the the comma if it's in a quoted string: so the result should be like:
# Director| Movie Title| Year| Comment
Ethan Coen| No Country for Old Men| 2007| none
Ethan Coen| "O Brother, Where Art Thou?"| 2000| none
Ethan Coen| The Big Lebowski| 1998| "uncredited (with his brother, Joel)"
I tried this but the output I get is : sed -e 's/(".)(.")/|\1 \2/g'
This is the result I am getting so far
Ethan Coen, |"O Brother, Where Art Thou? ", 2000, none
Ethan Coen, The Big Lebowski, 1998, |"uncredited (with his brother, Joel) "