cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

CSV with header, detail, and trailer records on S3

dwhansen-cbg
Contributor

I need to create a pipe delimited text file. The file needs to have a single header type record row with two columns, infinite number of detail record rows, and a single trailer type record row with three columns.

00|File Type Description
01|Data1|Data2|Data3|Data4|Data5|Data6|Data7|Data8|Data9|Data10
99|1|EOF

I thought I could use multiple CSV parsers + File writer snaps and then just APPEND the detail records and the trailer record, but it looks like the APPEND function isnโ€™t supported on S3. Any ideas on how to accomplish this?

5 REPLIES 5

dwhansen-cbg
Contributor

Does anyone at SnapLogic have any idea how to do this? This is a fairly common scenario in the healthcare world and I canโ€™t figure it out and need to have this pipeline working soon.

Ganesh
New Contributor II

Solution_2020_03_05.slp (10.5 KB)

Here is one way to achieve this as per the sample data.

koryknick
Employee
Employee

Here is another solution that uses Gate and JSON Generator to handle multiple records from any of the three incoming streams. Note that it does expect each of the incoming documents to have a single field โ€œrecordโ€ containing the full record data.

Header_Body_Footer_to_File.slp (12.3 KB)

i cannot get this to work as the body of the file is fixed format. A mapper snap does not work between the union and file writer either. Nothing is coming out at all.
image