Table of contents
- Introduction
- Example configuration
- When the file exists
Introduction
Alumio has been built to process large sets of data from one system to another system. For example, Alumio can read a CSV file with many lines and apply logic to each item before creating tasks.
In cases where items are to be sent to a file, a transformer step called “Write all items to a file” can be used. This step opens the file and appends each item. The result of this step is one item containing the path of the generated file.
Example configuration
In the following example, the “Write all items to a file” step has been configured to write items on an SFTP filesystem. It uses the NDJSON format and the file destination filename is stock.ndjson
.
Example input
Each line is an input item of the transformer.
{"id": 1, "stock": 5} {"id": 2, "stock": 2} {"id": 3, "stock": 0} {"id": 4, "stock": 0} {"id": 5, "stock": 1}
Example output
A single item.
{ "path": "stock.ndjson" }
Example output file
The step creates a file containing all input items called stock.ndjson
.
{"id": 1, "stock": 5} {"id": 2, "stock": 2} {"id": 3, "stock": 0} {"id": 4, "stock": 0} {"id": 5, "stock": 1}
When the file exists
When the file already exists on the destination filesystem, Alumio will overwrite it by default. It is possible to change this behaviour. Alumio will then add an increasing number to the filename.
In the following example, the destination would become stock-0.ndjson
and the next time the step is executed, the destination would become stock-1.ndjson
.
Open Screenshot from 2025-06-30 10-46-24.png
The template for the name can be changed, for example {filename}/{counter}.{extension}
would result in stock/1.ndjson
.
The format of the number can be changed, for example %05d
would add leading zeros to the number to make the filename stock-00001.ndjson.