Using the CSV Parser Snap Schema Capability

One of the features in the CSV Parser which customers sometimes request is the ability to define the fields (and their data types) for incoming CSV files. This is made easy by adding a second input view to the CSV Parser Snap, and providing the definition of the fields, and their data types in the flow.

For example, if you have input data in the CSV file as follows, with no header line:

Then, you can create a definition of the CSV data in another CSV file as follows:

Note the data types are optional, and defined on the second line of the input file. The parser supports the use of 'string', 'integer', 'float' and 'boolean' types. String is the default data type, any empty data type fields are considered to be strings.

The configuration of the pipeline for this use is as follows:



where the Read Snaps are File Reader .

The CSV Parser is configured as follows:



Views is configured as follows:



The resulting data in the SnapLogic pipeline data flow looks like this:

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