Create Filenames Using the CSV Formatter Snap
This example demonstrates how to use CSV Formatter Snap to (documents that contain purchase-related details and, depending on the value of the purchases) to route them into two documents, picking up their names using the output of the CSV Formatter Snap.

Download this pipeline
For the purpose of this example, we are picking up CSV data from a CSV Generator Snap. You can also supply this data using a combination of File Reader and CSV Parser Snaps.
We copy the output of the
CSV Generator
Snap and connect each copy to a
Filter Snap, where we filter out transactions based on whether they are worth more or less
than $40:




We now add a 'Bill_Type' binary header property to each set
of filtered outputs, so each document is tagged appropriately:


We now have two records, one containing all
transactions worth less than or equal to $40 and another containing all transactions over
$40. We now write each of these files to the SLDB using the File Writer Snap, configuring it
to include this classification of transactions in the filename. We do this using the
$Bill_Type+".csv" expression in the File name property.


You can now see that two new files were
created in the project: $Small.csv and $Large.csv:


Note:
To reuse the example pipelines:
- Download and import the SLP file into your Environment.
- Configure Snap accounts.
- Provide Pipeline parameters, if any.
