- Posts: 29
- Thank you received: 1
escaping special characters in import csv file
- bendegoose
-
Topic Author
- Offline
Less
More
12 years 10 months ago #134486
by bendegoose
escaping special characters in import csv file was created by bendegoose
-- 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 .
-- 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 or Create an account to join the conversation.
12 years 10 months ago #134497
by nicolas
Replied by nicolas on topic escaping special characters in import csv file
Hi,
Like most CSV compatible systems, double quotes can be escaped with another double quote.
www.google.com/search?q=escape+double+qu...10&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.
Like most CSV compatible systems, double quotes can be escaped with another double quote.
www.google.com/search?q=escape+double+qu...10&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 or Create an account to join the conversation.
- bendegoose
-
Topic Author
- Offline
Less
More
- Posts: 29
- Thank you received: 1
12 years 10 months ago #134584
by bendegoose
Replied by bendegoose on topic escaping special characters in import csv file
Thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.209 seconds