Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Suppose I input file with data below (1st row as header)
Column1|Column2|Column3|Column4
XYZ||ABC|
|LMN|ADI|MLN
GHI||LLL|AAA
I am expecting the output to have value as below
Output file data :-
Column1|Column2|Column3|Column4
"XYZ"||"ABC"|
|"LMN"|"ADI"|"MLN"
"GHI"||"LLL"|"AAA"
Whereever we have some value in a field ,it should be within double quotes (""). If no value is present in that field then no double quotes required. Fields are separated by |.
I am not able to do this using Text Enclosure under CSV option of tfileOutputDelimited.
You need an additional subjob to rework the outputfile after it has been produced with your actual tFileOutputDelimited.
In this new subjob, read the file with a tFileInputInputFullRow then in a tMap replace all the "" with the following expression:
row1.line.replaceAll("\"\"", "")
Then rewrite the output file with another tFileOutputDelimited component.
check csv options