Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
John Bultman
200
Views
3
Comments
[CSVUtil] double quotes
Question
Forge
CSVUtil (O11)
Forge asset by
Wei Zhu
I need double quotes on only a few text fields. Not all fields. Anyone know a way to selectively add quotes to fields? When I have double quotes in the data, they are removed. Any help is appreciated. Thanks.
Wei Zhu
Hi John
Double quote is used to enclose field that contains CR, LF, comma and double quote itself.
So if you need double quote, enclose that field with double quote and escape double quote in field with two double quotes.
For example , if your data is ab"cd, then in your CSV, that field should be "ab""cd".
Regards
Wei
John Bultman
Thanks for the reply, but it doesn't work for me. All I want is the double quotes around the field. So if field1,"field2",field3 then field2 should output with double quotes, not the rest. It seems to be all or nothing. If the double quote is in the field, your solution works, but not if surrounding the field.
Thanks,
John
Wei Zhu
The default setting use double quote to enclose and escape which is compatiable with Excel and RFC4180.
At this case, your data should be field1,"""field2""",field3.
But if there is no CR/LF/comma in field, you can use following solution to disable double quote
1. When import data from CSV, set IsDisableDoubleQuote of CSVLoadConfig to true.
2. When export data to CSV, set EncodeMode of CSVExportConfig to "noquote_nocheck".
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...