views:

22

answers:

1

Hello,

I have a csv file that is comma delimited. I have no problem 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?

Thanks in advance.

+1  A: 

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 :-)

godswearhats
That worked thank you so much :D
Toret