Flat file to JSON
Description
Flatfile to JSON allows parsing and conversion of CSV and fixed-width flat files to JSON format.
Usage
Flat file to JSON is used to convert CSV and fixed-width flat file data into JSON output. The source data must be provided in the Content field, where the column headers are defined. This can be a reference to the flat file data inline, as shown above or provided from a previous step as shown below.
- Delimiter: the delimiter is one character used to split the file into columns using the selected delimiter which can be comma-separated, tab-separated or custom. A backslash escapes special characters such as /t {tabular}.
- Quote: can be set to single or double quotes.
- Use first row as column names: ignore or take into account the first row, it will be used for column names.
CSV example
Flat file example
Using content from a previous step
Advanced configuration: Flatpack PzMap Schema
Camel Flatpack schema can be used to define the column lengths for flat file data or define the column names for CSV & flat files, as shown in the Flatpack schema example below:
Also it can be used to define the column names for CSV data:
For more details, see the Flatpack header and trailer records documentation.
For more details on using Flatpack, see the Camel Flatpack documentation.