我正在从Ruby生成CSV文件.问题是列字符串将包含双引号,单引号.我怎么能逃避这些事情呢?
"Mary had a little so called \"lamb\"","34","none"
"something is not \"right\"","23","none"
Run Code Online (Sandbox Code Playgroud)
每列用双引号括起来,后跟逗号(没有空格),并写入文件.
另外,如何将CSV插入MySQL?你需要使用像PHP的mysql_real_escape_string这样的东西吗?