For a content migration I had to import about 1000 nodes which I received in CSV format.

Field delimiter: ,
Escape character: \
Fields enclosed by: "
Lines terminated by: \n

The csv had stuff like align=\"left\" in it, which looks fine and quite "standard" to me, but Feeds didn't unescape the content so it was also importered with \"-s in it.

After many attempts I discovered by accident that double double quotes were imported correctly: align=""left"". But the only way to get the double double quotes was to export to LibreOffice and save as csv. PMA and SELECT INTO didn't produce such csv's.

A configurable escape character would have saved me many hours... Unfortunately, Feeds does not use fgetcsv() but a custom csv parser, so I couldn't fix it myself...

Comments

colan’s picture

Version: 7.x-2.0-alpha4 » 7.x-2.x-dev

> Feeds does not use fgetcsv() but a custom csv parser, so I couldn't fix it myself...

Let's get that one done first: #1369874: Don't roll own CSV parser; use PHP's native one

colan’s picture

Title: Configurable escape character » The escape and enclosure characters should be configurable

Let's generalize this a bit.

adbo’s picture

subscribe

gaëlg’s picture

bluegeek9’s picture

Component: Feeds Import » Code
Issue summary: View changes
Status: Active » Closed (outdated)
Issue tags: -import, -CSV, -escape, -character
//www.flaticon.com/free-icons/thank-you Thank you for your contribution!

Unfortunately, Drupal 7 is End of Life and no longer supported. We strongly encourage you to upgrade to a supported version of Drupal.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.