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.
...
Expand | ||
---|---|---|
| ||
Using the + Component button button, import the To File component. |
Expand | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
Any field Fields marked with red is an asterisk* are required, otherwise the default value inside the default values defined in config.json will take its place. FIELD NAMEare used:
QuickstartIf you want one file for all messages If you want one file for all the messages that came in a second/minute/hour/day/month/year You can remove the timestamp masks to match your needs here (S = seconds, M = minutes and so on…) If you want one file for every message Timestamp masks still get their values replaced with the current time but will not save multiple messages in one file.
|
Expand | ||
---|---|---|
| ||
Start the component. Once messages arrive to the componentinbound messages are processed, check the defined destination directory to see your newly created file(s). |
Additional Details
...
Example Configurations
Expand | ||
---|---|---|
| ||
Is the directory where the file(s) will be stored. The adapter will attempt to create it if it does not exist. | ||
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 every message:
|
Expand | ||
---|---|---|
| ||
If you want one file for all the messages that came in the same second/minute/hour/day/month/year:
If 2 bits of data arrived at 2024/12/30 at 16:45:55. They , they will be written to the same exact same file with the name “output_2024_12_30_16_45_55.txt” (unless the OneFilePerMessage field is set to true). If another bit came a second later, it will create a new file “output_2024_12_30_16_45_56.txt” and so on. |
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 add and remove masks as you pleasemodify a mask as required, but the smallest unit will determine how often a new file is created/a roll-over happens. So essentially, you can organize the This allows you to organize data by the second/minute/hour/day/month/year (or millisecond) they it arrived in. | ||
Expand | ||
title | OneFilePerMessageThis field is only used if you would like to put every single message that came in into its own file. If the OutputFileMask is “output.txt” then the files generated will be output.txt, output(1).txt, output(2).txt and so on…Similarly, it does support the time masks, so assuming the OutputFileMask is “output_%Y_%m_%d_%H_%M_%S.txt” and two messages come in at the same time then the name of the files will be: “output_2024_12_30_16_45_55.txt” and “output_2024_12_30_16_45_55(1).txt” |
Expand | ||
---|---|---|
| ||
Used to indicate the type of encoding that you would like your data to be converted to (from UTF-8 by default), list of available encoding to convert can be found below. |
Expand | ||
---|---|---|
| ||
When set to true, it will append “.tmp” to files currently being written until the component is done writing to them. It will only remove the .tmp extension when a new file is written in. |
Expand | ||
---|---|---|
| ||
When writing messages out, non-ASCII characters, like accented characters, can be escaped. E.g., "é" would be sent as "\XE9\" (in Latin-1 or Windows-1252) or "\XC3\\XA9\" (in UTF-8). |
...
will have masks replaced with timestamps as follows:
|
Expand | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||
|