In Syntasa’s TO FILE process (also previously known as the Publish process), users can customize output file names using dynamic parameters. These parameters are replaced at runtime with actual values from the dataset or execution context, allowing for meaningful and unique file names. This capability is particularly useful when organizing outputs by row count, date range, data volume, or partition. Each parameter is written using curly braces and an at-symbol, such as {@rows} or {@date}.
Below is a detailed explanation of each supported parameter and how they behave during file generation.
@ROWS
This parameter is replaced with the total number of records (rows) in the final data being exported. For example, if the output file contains 5 records and the file name is sales_{@ROWS}.csv, it will become output_5.csv.
@COLUMNS
This parameter is replaced with the total number of fields(columns) in the final data being exported. For example, if the output file contains 7 columns and the file name is sales_{@COLUMNS}.csv, it will become output_7.csv.
@FROM_DATE
This is replaced with the earliest date from the list of dates being processed during that job run. If no specific dates are being processed, this value will be blank. It’s often used when the exported data is filtered by date. For example, if the job is processing data for the date range from 1st January 2025 to 5th January 2025, and the file name pattern is output_{@from_date}.csv, then the final file name will be output_2025-01-01.csv
@TO_DATE
This parameter inserts the latest date from the list of dates being processed. For example, for the same job with a date range from 1st January 2025 to 5th January 2025, if the file name pattern is output_{@TO_DATE}.csv , then the output file will be named output_2025-01-05.csv
@DATE
This parameter inserts the current date or time into the file name. You can format the output using any valid Java date format such as yyyy-MM-dd, yyyyMMdd, or yyyy_MM_dd_HH_mm. If you use {@date:epoch}, it will insert the current timestamp in milliseconds since epoch.
Examples:
- File name:
output_{@date:yyyyMMdd}.csv
Output:output_20250702.csv - File name:
output_{@date:epoch}.csv
Output:output_1751452800000.csv
(Exact number will vary depending on the time of execution)
@SPLIT
This is used when multiple output files are created due to a file size limit (using Max Split Size). The @SPLIT parameter will be replaced with a number like 1, 2, etc., for each file. For example, if file name is output_{@SPLIT}.csv and two files are created, they will be named output_1.csv and output_2.csv.
@CHECKSUM
This parameter is replaced with a checksum value, which is a short unique code based on the file name itself. It can be useful when you need to ensure file uniqueness or verify file integrity. For example, if file name is output_{@CHECKSUM}.csv, it will become output_a91f31b3.csv
Important Note:
Currently, these dynamic file name parameters—such as {@rows}, {@columns}, {@from_date}, {@to_date}, {@checksum}, and {@date}—are supported only for the primary output file in the To File process.
If you're using Additional Files, only the {@split} parameter is supported at this time. This means you can generate separate additional files for each primary file chunk (e.g., success_1.txt, success_2.txt, etc.), but other parameters like {@rows} or {@date} will not apply to additional files yet.
Support for more parameters in additional files is planned for a future release.