Thanks in advance!
I've created an IPA that does this. Once I get the data in csv format I'm using the below js.You would create and set the delim variable to |
var temp=GetResult_result.toString();
if (delim !== ",") { var line = "'" + temp + "'"; var newLinesArray = []; var regex = /"(.*?)"/g; var matches = line.match(regex);
if (matches) { for (var j = 0; j < matches.length; j++) { line = line.replace(matches[j], matches[j].replace(/,/g, '<COMMA_PLACEHOLDER>')); } }
var lineArray = line.split(',');
for (var k = 0; k < lineArray.length; k++) { lineArray[k] = lineArray[k].replace(/<COMMA_PLACEHOLDER>/g, ','); }
var newLine = lineArray.join(delim); newLinesArray.push(newLine);
// Convert the modified lines array back to a string var newLines = newLinesArray.join(''); temp = newLines.slice(1); temp = temp.slice(0, -1);}
data=temp;
this is followed by a write file node that uses the data var.
This code is more complicated that you might expect just because you could have a comma in your dataset (like in a description or something) and we wouldn't want to replace that with a special delimiter.
[edit] just realized the code above is wrapping the data in single quotes and then removing them at the end, that was from some earlier testing and I don't think its needed now
Thanks for the tip! I was hoping there was DSV setting I could use, and I did see reference to "separator: "|"" in Infor's documentation, but I am not sure how to use it and have not been successful in my attempts to use it in the API.
If you find something that works to just pull the data with the desired separator definitely post it here as it would simplify my IPA a bit. Looking at the API Gateway and the Infor Data Fabric compass/v2 endpoint documentation I only saw response content type of application/x-ndjson and text/csv. Params were just the query id, offset, limit, queryExecutor, accept-encoding, and range.
The IPA I wrote is a generic one that will take any query and return the data in almost any format (email, ftp, any delim, any extension, any line ending etc) and removing a bit of code would be a bonus.
I will let you know if I find something - looking at the API, I don't see a way to change the delimiter. Maybe they'll update it in a future release.