List:General Discussion« Previous MessageNext Message »
From:Neil Aggarwal Date:December 15 2009 4:11am
Subject:RE: CSV pain and suffering with punctuation and non-ASCII characters
View as plain text  
Jan:

> For example, importing a quote with a "Context" field of:
> 	The Hitchhiker's Guide to the Galaxy
> 
> results in a field containing:
> 	The Hitchhiker

You are going to have to escape quotes, so your string should
look like this:
 	The Hitchhiker\'s Guide to the Galaxy

See this page:
http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html

Whenever I run into this situation, I use the Ostermiller
Excel CSV parser:
http://ostermiller.org/utils/ExcelCSV.html
with a custom class I wrote to escape strings using the
MySQL format.  I don't know if there is an off the shelf
tool to do what you want.  Maybe someone has one.

	Neil

--
Neil Aggarwal, (281)846-8957, http://UnmeteredVPS.net
Host your MySQL database on a CentOS virtual server for $25/mo
Unmetered bandwidth = no overage charges, 7 day free trial

Thread
CSV pain and suffering with punctuation and non-ASCII charactersJan Steinman15 Dec
  • RE: CSV pain and suffering with punctuation and non-ASCII charactersNeil Aggarwal15 Dec