Introduction
The To File component is a destination component that writes incoming data to a file or multiple files as needed. It serves to expand on the File Writer component with additional configurations and settings.
This adapter can be easily modified to add additional functionality or to fulfil extra requirements.
Running the Component
Info |
---|
The below steps assume the correct user permissions are in place to read/write files. |
Expand | ||
---|---|---|
| ||
Using the button+COMPONENT, import the To File component. |
Expand | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||
Fields marked with an asterisk* are required, otherwise default values defined in config.json are used:
|
Expand | ||
---|---|---|
| ||
Start the component. Once inbound messages are processed, check the defined destination directory to see your newly created file(s). |
Example Configurations
Expand | ||
---|---|---|
| ||
If you want one file for all messages:
The OutputFileMask will behave differently depending if OneFilePerMessage is set to true:
|
...
Expand | ||
---|---|---|
| ||
If you want one file for all the messages that came in the same second/minute/hour/day/month/year:
The OutputFileMask is both the format of the outbound file names as well as can be used to determine when a new file is created. You can modify a mask as required, but the smallest unit will determine how often a new file is created/a roll-over happens. This allows you to organize data by the second/minute/hour/day/month/year (or millisecond) it arrived in.
|
Additional Details
Expand | ||
---|---|---|
| ||
The OutputFileMask is the format for the name that the resulting files will take. It can also be used to determine when a new file is created. You can modify a mask as required, but the smallest unit will determine how often a new file is created/a roll-over happens. This allows you to organize data by the second/minute/hour/day/month/year (or millisecond) it arrived in. “output_%Y_%m_%d_%H_%M_%S.txt” will have masks replaced with timestamps as follows:
|
Expand | ||
---|---|---|
| ||
Encoding Name | Code | |
Chinese (Big 5 HKSCS) | BIG5-HKSCS | |
Chinese (GB 18030) | GB18030 | |
Chinese (GB 2312) | GB2312 | |
Chinese (GBK) | GBK | |
Japanese (ISO-2022-JP) | ISO-2022-JP | |
Korean (ISO-2022-KR) | ISO-2022-KR | |
Western (ISO-8859-1) | ISO-8859-1 | |
Central European (ISO-8859-2) | ISO-8859-2 | |
South European (ISO-8859-3) | ISO-8859-3 | |
Central European (ISO-8859-4) | ISO-8859-4 | |
Cyrillic (ISO-8859-5) | ISO-8859-5 | |
Arabic (ISO-8859-6) | ISO-8859-6 | |
Greek (ISO-8859-7) | ISO-8859-7 | |
Hebrew (ISO-8859-8) | ISO-8859-8 | |
Turkish (ISO-8859-9) | ISO-8859-9 | |
Western (Windows-1252) | Windows-1252 | |
Chinese (Big 5) | big5 | |
Japanese (EUC-JP) | eucJP | |
Japanese (Shift JIS) | sjis | 8-Bit Unicode | UTF-8