Creating CSV file with Header in first column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2023 06:43 AM - edited ‎08-11-2023 07:01 AM
Hi SnapLogic experts,
i have question, if described example could be done via snaplogic. Output should be .csv file with structure:
Column1
Column2
Column3
Column4
Column1Values,Column2Values,Column3Values,Column4Values
"Headers" should be in first column of target file and after last header (Column4) csv should continue with values of specific headers but in separated columns.
I can do it with 4 columns, but my real example is more than 500 headers, and there is problem with string length and my headers are trimmed.
So what will be best approach to do it via snaplogic? Is it even possible to do it via one CSV parser, due to delimiter rules or so? thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2023 11:44 AM
Hi @SL12345 ,
How are you receiving your inputs? Is the input a list or object?
Assumption: input object are received as streaming object
Use a Gate snap to put all received "input" object into an array, once in an array you can use the below expression to pivot the input as header name and value
$inputs.filter((a,b,c)=> b < ($inputs.length - 1)).map(i=> i['input']).toObject((v,i)=> v, (v,i)=> $inputs[$inputs.length - 1]['input'].split(',')[i])
Is this what you're trying to achive?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 01:32 AM
hi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 01:37 AM
Hi @alchemiz,
Can you please provide pipeline to download. I didn't get what to use inside pivot snap.
