I have a csv file that is comma delimited. I have no pr开发者_运维技巧oblem with the importing aspect of it except for when the import reaches a line like this:
1,2,3, Canada's,5, 6,7
The import crashes when it reaches the single quote. Does anyone know of a program I could use to import my csv file in to sqlite database without having to get rid of all my single quotes?
Try this on the command line (i.e. in Terminal):
cat filename.csv | sed "s/'/\\\\'/g" > new_filename.csv
That will create a new file with all the single quotes escaped with a backslash, which should allow you to import it. Of course, it depends on whether your importer recognizes backslashes, but it's worth a try :-)
精彩评论