i have a CSV file with 4 columns. e.g.
1132,John Doe,johndoe@gmail.com,3534534543
53213,John Doe,johndoe@test.com,51352363126
I want to add double quotes for every value so I use this script on MAC:
sed 's/[^,]*/"&"/g' file.csv > file2.csv
I receive
"1132","John Doe","johndoe@gmail.com","3534534543
"
"53213","John Doe","johndoe@test.com","51352363126
"
So I get the last quotes on new rows, most probably I should remove /r/n somehow, I tried but I couldn`t. Any ideas? It happens with the files that I receive if I fill values manually it works as expected.