I've got a large CSV file which is supposed to have two fields. It should look basically like this:
1234, Some series of words
539345, Something else
2039, "quotes are, of course, necessary here"
The problem is that the quotes on line 3 are missing, and there are many lines like this. I have recorded a macro to do the following:
- Go to the beginning of a line
- Move to the spot just after the first comma
- Insert a quotation mark
- Go to the end of the line
- Append a quotation mark
However, even with this macro, I have to manually scan through the file, playing it back on lines with multiple commas. I can't do it on every line, because that's not a valid CSV.
What I'd like is a substitution command that says: "for lines with more than one comma, place a quote after the first comma and a quote at the end of the line."
Anybody care to take a swing at that?