Try the following Python script, just for fun.
It adds quotes to strings in the CSV that don't have them already.
This is a really simple approach - you will likely find corner cases that don't work for you (strings with embedded quotes and commas?). Fix it!
(oh, this can be written in far less lines of code, I know. Not the point here).
import sys
import re
def addQuotes( str ):
matches = re.match( '^".*"$', str )
if matches == None:
return '"' + str + '"'
return str
# Iterate over standard input. NOTE - this isn't line-buffered, don't try using
# this script interactively...
for line in sys.stdin:
# Remove trailing linefeed.
line = line.strip()
# Split the line into parts separated by commas.
parts = line.split( ',' )
# Add quotes to each part that doesn't have quotes already.
newParts = map( addQuotes, parts )
# Concatenate the parts back to a single line.
concatParts = ','.join( newParts )
# And print it.
print concatParts
Pipe the CSV file to this, using something like -
python QuoteCSV.py < input.csv