Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Exporting from Tinderbox >> Escaping straight double quotes for CSV export
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1341411495

Message started by Mark Anderson on Jul 4th, 2012, 10:18am

Title: Escaping straight double quotes for CSV export
Post by Mark Anderson on Jul 4th, 2012, 10:18am

Some apps that consume CSV (comma separated variable) delimited data require that some/all field (attribute) values are enclosed is straight double quotes.  If that character occurs within a value, it must be escaped by doubling it. Thus a $Text of:

He shouted "Hello!" at the top of his voice.

must be exported as:

"He shouted ""Hello!"" at the top of his voice."

This can be done with String.replace('"','""'), noting that single straight quotes need to be used as the pattern delimiter for the find & replace patterns in the TB code. Note there is no need to escape typographic double quotes, i.e. 'smart' or 'curly\ quotes, just the straight ones.

More here.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.