sqr - Addressing both commas and double quotes in a CSV -


i writing report in sqr produces csv output file. while testing, ran instance following string used in 1 of fields:

table - 210" x 60" x 29", oak,

i have double quotes surrounding string. when use method, output produced this:

col 1 |col 2|col 3

table - 210 x 60" x 29" | oak | ,

obviously, entire line should fit in first column.

i understand it's possible use other delimiters, prefer keep comma delimiter. know of way address issue?

here simplified version of current code:

let $asset_descr = '"' || &dep_asset.descr || '"' let $string = $asset_descr write 1 $string  

i able solve after lot of searching , testing. in order fix this, replaced each double-quote 2 double-quotes. having 2 double-quotes treats double-quote 'escape value'... guess means double-quote not treated closed quote.

this might sqr specific solution.

simplified code solution:

let $asset_descr = '"' || replace(&dep_asset.descr, '"', '""') || '"' let $string = $asset_descr write 1 $string  

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -