skodali
7 years agoNew Contributor III
How to merge CSV files
I have ‘n’ CSV files which have different data only in the first column separated by “|” but don’t have a header in a folder. How can I merge all of them into one single CSV file?
It looks like the document has the data spread across a few arrays. So, at some point, you’ll want to use a JSONSplitter to get your final result. But, first, you’ll need to combine the different arrays into one array that can be split. I think the following expression can be used to combine things together:
$BillStatus.map((elem, index) => {
BillStatus: elem,
ApplyingTransAmount: $ApplyingTransAmount[index],
ApplyingTransDocNum: $ApplyingTransDocNum[index],
ApplyingTransType: $ApplyingTransType[index]
})
That expression uses the Array.map()
method to walk over the elements of the $BillStatus
array and then produce a new array of objects with the values from the other arrays. Putting that expression in a mapper and then following that up with a JSONSplitter should get you what you want.
Here’s a pipeline that does as much:
I am also facing same issue with NS. I have tried different option (child pipeline,task execution etc). Looks like ultra is only returning single value not any response array. I found in ultra no batch mode is supported. But we need a confirmation from Snap team. It will be great if you found something and post it on this forum.
@nmaniyar
Hi Nidhi - we are seeking your help on this.