1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
537 views
by brandon-w-8204 (34.1k points)
edited by brandon-w-8204

Here is my source csv:

533837,2250666,0195772,80053,Comprehensive Metabolic Panel,4440408,15.5400,20161010000000,3710011202,20161011000000,2282312,100.0000,13

I need it to look like this.

533837|2250666|0195772|80053|Comprehensive Metabolic Panel|4440408|15.5400|20161010000000|3710011202|20161011000000|2282312|100.0000|13
 

1 Answer

0 votes

You can accomplish this using the following code.

// set message to Pipe delimited file (without header row)
message = qie.createCSVMessage(false, '"', '|', '', false);

// or, set message to Pipe delimited file (with header row)
//message = qie.createCSVMessage(false, '"', '|', '', true);

//Convert via a regular expression
message.setNode('/', source.getNode('/').replaceAll('(,)(?=(?:[^"]|"[^"]*")*$)', '|'));

by brandon-w-8204 (34.1k points)
edited by brandon-w-8204
...