Hello,
Thanks for such a great module. I am having a problem importing any content that includes quotes (single or double). What is the correct escape sequence (e.g. \') to get around these problems? If there are no escape sequences, what would be the best way to get around the problem?
Thanks
Comments
Comment #1
goodeit commentedI'm not sure this qualifies as "fixed", but maybe it will help someone:
what I did was use OpenOffice to export my CSV as TAB delimited, with no field delimiters (e.g. not ' or "). Then node_import successfully imports standard quotes and single quotes just fine.
-------------
Example File:
Product Price SKU DESCRIPTION
Car 4000 REDCAR This car's on fire!
Truck 6000 BLUETRUCK This car is "blue!"
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #3
jako0013 commentedI have this issue as well and it is not clear from the code how to fix this. Does anyone have an idea or is the module author out there still?
Comment #4
goodeit commentedLooking at this again, I was mistaken -- it appears that double quotes (") still do not import correctly, even if the Text qualifier symbol is set to blank or a different character.
Changing all double quotes to & quot; (no space - html markup) works fine for body fields, but if there are any titles with double quotes, the text "& quot;" shows in the titles.
EDIT: whoops html markup fix
Comment #5
goodeit commentedOK, I think I have figured this out. Per the node_import code, the default escape sequence is \[character] e.g. \" . The reason it wasn't working for me was that OpenOffice was automatically converting my double quotes into either right or left quotes... which then broke node_import. This isn't necessarily a node_import bug so much as something its not designed to handle.
To turn off automatic quote changes in OpenOffice, go to Tools -> AutoCorrect -> Custom Quotes and uncheck "double quotes".
Make sure you check your CSV with another program (I recommend Notepad++) because OpenOffice seems to be doing other weird things to my CSV, such as adding in an extra set of quotes.
I believe this answers my original question, so I'm going to close this. If anyone else has another problem, feel free to reopen.
Comment #6
neclimdulActually I think this is a bug. Doubled quote escaping is an excepted behavior in both MS Office and OpenOffice and is defined in RFC 4180.
This is causing a problem with Views Bonus built CSV's because it follows this pattern.
#205741: [PATCH] Can an CSV Export Preserve Links, Formatting, Etc. in Fields?
Comment #7
rkendall commentedI'm having a problem with this as well, as per #6, although I am using user_import with content_profile (which also requires node import).
I noticed that user import and node import seem to have different methods. user_import uses PHP's fgetcsv for which this is a known problem: http://bugs.php.net/bug.php?id=50686
Isn't there a proven PHP CSV parser that can be incorporated to fully support CSV formats? Maybe a separate file parser import/export API module is needed?
Comment #8
cyberwolf commentedSubscribing