[Skip to main content](#vessel-content)

#   escaping special characters in import csv file

##

- **[bendegoose](/forum/user/29609-bendegoose "View bendegoose's Profile")**
- [![bendegoose's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/29609-bendegoose "View bendegoose's Profile") Topic Author
- [ Offline](/forum/user/29609-bendegoose)

Less More

- Posts: 29
- Thank you received: 1
-
-

13 years 6 days ago [\#134486](#134486) by [bendegoose](/forum/user/29609-bendegoose "View bendegoose's Profile")  *[escaping special characters in import csv file](/forum/37-import-export-csv-xls/863964-escaping-special-characters-in-import-csv-file#134486 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 2.5 -- PHP version -- : 5.5.3  Hi,  I haven't found any description about how to escape special characters in the import CSV file. I found that comma must be just escaped by a backslash: &#92;, But how to do with the double quote?  Here is an example for the import file content:  category, product&#95;code, product&#95;name, product&#95;description &quot;cat1&quot;, &quot;001&quot;, &quot;prod1&quot;, &quot;descr1 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr1 end&quot; &quot;cat1&quot;, &quot;002&quot;, &quot;prod2&quot;, &quot;descr2 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr2 end&quot;  In case of an import like the above I always get the next message: The line '&quot;cat1&quot;, &quot;001&quot;, &quot;prod1&quot;, &quot;descr1 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr1 end&quot;' could not be imported The line '&quot;cat1&quot;, &quot;002&quot;, &quot;prod2&quot;, &quot;descr2 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr2 end&quot;' could not be imported  How should I import texts including double quotes. And including other specal characters?  Thanks .")* was created by *[bendegoose](/forum/user/29609-bendegoose "View bendegoose's Profile")*

-- HikaShop version -- : 2.2.2
-- Joomla version -- : 2.5
-- PHP version -- : 5.5.3

Hi,

I haven't found any description about how to escape special characters in the import CSV file.
I found that comma must be just escaped by a backslash: \,
But how to do with the double quote?

Here is an example for the import file content:

category, product_code, product_name, product_description
"cat1", "001", "prod1", "descr1 Blah blah\, blah blah blah \"blah blah\". descr1 end"
"cat1", "002", "prod2", "descr2 Blah blah\, blah blah blah \"blah blah\". descr2 end"

In case of an import like the above I always get the next message:
The line '"cat1", "001", "prod1", "descr1 Blah blah\, blah blah blah \"blah blah\". descr1 end"' could not be imported
The line '"cat1", "002", "prod2", "descr2 Blah blah\, blah blah blah \"blah blah\". descr2 end"' could not be imported

How should I import texts including double quotes. And including other specal characters?

Thanks .

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ltcG9ydC1leHBvcnQtY3N2LXhscy84NjM5NjQtZXNjYXBpbmctc3BlY2lhbC1jaGFyYWN0ZXJzLWluLWltcG9ydC1jc3YtZmlsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

13 years 6 days ago [\#134497](#134497) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[escaping special characters in import csv file](/forum/37-import-export-csv-xls/863964-escaping-special-characters-in-import-csv-file#134497 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 2.5 -- PHP version -- : 5.5.3  Hi,  I haven't found any description about how to escape special characters in the import CSV file. I found that comma must be just escaped by a backslash: &#92;, But how to do with the double quote?  Here is an example for the import file content:  category, product&#95;code, product&#95;name, product&#95;description &quot;cat1&quot;, &quot;001&quot;, &quot;prod1&quot;, &quot;descr1 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr1 end&quot; &quot;cat1&quot;, &quot;002&quot;, &quot;prod2&quot;, &quot;descr2 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr2 end&quot;  In case of an import like the above I always get the next message: The line '&quot;cat1&quot;, &quot;001&quot;, &quot;prod1&quot;, &quot;descr1 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr1 end&quot;' could not be imported The line '&quot;cat1&quot;, &quot;002&quot;, &quot;prod2&quot;, &quot;descr2 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr2 end&quot;' could not be imported  How should I import texts including double quotes. And including other specal characters?  Thanks .")*

Hi,

Like most CSV compatible systems, double quotes can be escaped with another double quote.
[ www.google.com/search?q=escape+double+qu...10&amp;es\_sm=93&amp;ie=UTF-8](https://www.google.com/search?q=escape+double+quotes+in+CSV&oq=escape+double+quotes+in+CSV&aqs=chrome..69i57j0.4983j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8)

So it should be:
category, product_code, product_name, product_description
"cat1", "001", "prod1", "descr1 Blah blah, blah blah blah ""blah blah"". descr1 end"
"cat1", "002", "prod2", "descr2 Blah blah, blah blah blah ""blah blah"". descr2 end"

Normally, commas don't have to be escaped if the string they are in is double quoted.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ltcG9ydC1leHBvcnQtY3N2LXhscy84NjM5NjQtZXNjYXBpbmctc3BlY2lhbC1jaGFyYWN0ZXJzLWluLWltcG9ydC1jc3YtZmlsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bendegoose](/forum/user/29609-bendegoose "View bendegoose's Profile")**
- [![bendegoose's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/29609-bendegoose "View bendegoose's Profile") Topic Author
- [ Offline](/forum/user/29609-bendegoose)

Less More

- Posts: 29
- Thank you received: 1
-
-

13 years 5 days ago [\#134584](#134584) by [bendegoose](/forum/user/29609-bendegoose "View bendegoose's Profile")  Replied by *[bendegoose](/forum/user/29609-bendegoose "View bendegoose's Profile")* on topic *[escaping special characters in import csv file](/forum/37-import-export-csv-xls/863964-escaping-special-characters-in-import-csv-file#134584 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 2.5 -- PHP version -- : 5.5.3  Hi,  I haven't found any description about how to escape special characters in the import CSV file. I found that comma must be just escaped by a backslash: &#92;, But how to do with the double quote?  Here is an example for the import file content:  category, product&#95;code, product&#95;name, product&#95;description &quot;cat1&quot;, &quot;001&quot;, &quot;prod1&quot;, &quot;descr1 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr1 end&quot; &quot;cat1&quot;, &quot;002&quot;, &quot;prod2&quot;, &quot;descr2 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr2 end&quot;  In case of an import like the above I always get the next message: The line '&quot;cat1&quot;, &quot;001&quot;, &quot;prod1&quot;, &quot;descr1 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr1 end&quot;' could not be imported The line '&quot;cat1&quot;, &quot;002&quot;, &quot;prod2&quot;, &quot;descr2 Blah blah&#92;, blah blah blah &#92;&quot;blah blah&#92;&quot;. descr2 end&quot;' could not be imported  How should I import texts including double quotes. And including other specal characters?  Thanks .")*

Thank you!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ltcG9ydC1leHBvcnQtY3N2LXhscy84NjM5NjQtZXNjYXBpbmctc3BlY2lhbC1jaGFyYWN0ZXJzLWluLWltcG9ydC1jc3YtZmlsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.054 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
