cancel
Showing results for 
Search instead for 
Did you mean: 

Generating individual files based on 'n' records from the input data (excel) file

darshthakkar
Valued Contributor

Hi Community,

Looking forward to your suggestions (I’m brand new to snapLogic and wanting to learn more!)

→ Input is an excel file with multiple columns, I’m planning to fetch 2 columns only from those multiple columns (this has been achieved so far)

→ For instance, the total records in an excel file are 10, I would want 10 individual csv and html files (with those 2 columns only) generated with filename as (row1col1 value).csv, (row1col1 value).html, (row2col1 value).csv, (row2col1 value).html and so on and so forth.

Thank you in advance for your help 🙂

1 ACCEPTED SOLUTION

darshthakkar
Valued Contributor

The solution was achieved by using "Group By N" snap with the below settings:

darshthakkar_0-1727474574263.png

Some transformation happened after that and it was fed to a pipeline execute which generated individual html/csv files for me. This has worked seamlessly for 45k+ files in a single execution though it takes around 15m for pipeline completion.

darshthakkar_1-1727474692048.png

Don't forget to use the below snap "Document to Binary" before generating html files via the File writer:

darshthakkar_2-1727474759422.png

Thank you.

 

Best Regards,

Darsh

 



View solution in original post

3 REPLIES 3

Aleksandar_A
Contributor III

Hi @darshthakkar,

Try using Pipeline Execute Snap, so you can write one file per one input document. Also you can pass snap.in.TotalCount as Parameter so you can name the files as you listed before.
Below is the Pipeline Execute Snap Settings:
image
The Child Pipeline that is used for writing the files should look like this:
image
And the File Writer Snap Settings:
image

Note * This is only for csv files, there is not a html formatter in the available Snaps. *
For dynamic formatting a html file head over to https://community.snaplogic.com/t/how-to-generate-a-html-file-with-snaplogic/1186

BR,
Aleksandar

Thank you @AleksandarAngelevski, I will try with the solution you’ve provided.
Your help is much appreciated.

darshthakkar
Valued Contributor

The solution was achieved by using "Group By N" snap with the below settings:

darshthakkar_0-1727474574263.png

Some transformation happened after that and it was fed to a pipeline execute which generated individual html/csv files for me. This has worked seamlessly for 45k+ files in a single execution though it takes around 15m for pipeline completion.

darshthakkar_1-1727474692048.png

Don't forget to use the below snap "Document to Binary" before generating html files via the File writer:

darshthakkar_2-1727474759422.png

Thank you.

 

Best Regards,

Darsh