The Key-Value output format in the TO FILE process allows you to export your structured data into a flat text format where each row contains key-value pairs. Syntasa’s TO FILE process gives users complete control over how output data is formatted by allowing custom delimiter values in Key-Value output files. Rather than being restricted to specific characters, users can define their own ID Delimiter, Key-Value Pair Delimiter, Key-Value Delimiter, and Array Delimiter based on the needs of their downstream systems. For example, you may choose a comma, pipe (|), colon (:), tab (\t), or any other character. This flexibility allows you to generate output files in formats compatible with legacy systems, APIs, flat-file ingestions, or any third-party tools expecting a specific structure.
In this guide, we'll walk through how to configure each field when generating a Key-Value output file in Syntasa.
Understanding Each Field on the Parameters Screen for Key-Value Output
Let’s assume your input data looks like this:
visitor_id, name, browser, city, subjects
1, James, Safari, New York, {Maths, English, Science}
2, Ricky, Chrome, New York, {Maths, Science}And you want your output file to be:
1, name:James|browser:Safari|city:New York|subjects:Maths;English;Science 2, names:Ricky|browser:Chrome|city:New York|subjects:Maths;Science
Here's how each field in the Parameter screen should be filled out to achieve this:
ID Field
This is the column that will act as the unique identifier at the beginning of each line in the output file. In the example above, visitor_id is used as the ID field. It will appear before the key-value pairs.
ID Delimiter
This defines the character that separates the ID from the rest of the line. If you use a comma (,), the output will start like:
1, name:James ...
Key-Value Pair Delimiter
This is the symbol used to separate each key-value pair in a row. In our example, | is used, which produces:
name:James | browser:Safari | ...
Key-Value Delimiter
This symbol separates the key from its value. Using : will turn name and James into name:James.
Array Delimiter
If your data contains arrays (such as multiple subjects), this delimiter separates the values within that array. For example, if the subject list is {Maths, English, Science} and you use; as the array delimiter, it will be written as:
subjects:Maths;English;Science
Other Fields
Other configuration fields, such as Compression Type, Max Split Size, Output File Name, External File Path, and Additional Files, behave the same way as they do in the Standard output configuration. This consistency ensures a smooth experience when switching between file formats, without needing to relearn or reconfigure these settings. Users can apply the same logic for splitting files, customizing file names using parameters, and generating additional files alongside the output. To learn more about these shared settings, please refer to the article: Understanding Parameters Screen for Generating Standard Output File.
The Key-Value output format in Syntasa is highly customizable and useful when you want to export flat, delimited text files containing readable key-value pairs. By adjusting delimiters and specifying how arrays and keys are formatted, you can generate outputs suited for downstream systems and external integrations.