How would you escape properly the delimiter char from actual content when exporting an XLS to CSV?.
When I export a file, the delimiter is ";" character which is also found in some fields. I need to escape it
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is actually no completely accepted standard for the CSV “format”.
Standard practice, however, is:
Enclose any field values with a “special character” in double-quotes.
For any field values that are enclosed in double-quotes, escape any internal double-quote characters in the field by repeating the double-quote character.
So, ID = 10, Name = Doe; John, Nickname = Johnny “The Chin” would look like this:
if you’re using semi-colons (commas are more common, hence the name Comma Separated Values).
Special characters that require the quoting are the delimiter (whatever it is), the double-quote character itself, and line breaks (if both the sending and receiving programs support line breaks within a field). However, if both the sending and receiving programs support the use of double-quotes around field values, it doesn’t hurt to include them for all fields.