Overview
This node, named 'Text File Parser', is designed to process and parse text files in various ways. It supports three main operations: reading a text file's binary content and converting it to text, parsing a text file with fixed-length format lines, and mapping content fields from fixed-length source fields. It is useful in scenarios where text files need to be ingested, parsed, and transformed into structured JSON data for further automation workflows. For example, it can parse log files with headers and footers, extract fixed-length data fields from text records, or simply read and output the content of a text file.
Use Case Examples
- Parsing a fixed-length formatted text file with header and footer lines to extract meaningful data records.
- Reading a binary text file input and converting it to UTF-8 text for further processing.
- Mapping fixed-length fields from a text content field into structured JSON fields based on user-defined start positions and lengths.
Properties
| Name | Meaning |
|---|---|
| Input Text Field | The name of the input field containing the text content to be parsed (e.g., 'content'). This is required for the 'Parse Text File' operation. |
| Parser Options | Options to control parsing behavior for the 'Parse Text File' operation, including whether the file has a header or footer line and the characters that these lines start with. |
Output
JSON
jsoncontent- The full text content of the file or parsed line content.fileName- The name of the file, if available from input data.type- The type of line parsed (e.g., 'line', 'header', 'footer').line- The actual line content from the text file.header- The header line content if the file has a header.footer- The footer line content if the file has a footer.error- Error message if an error occurs and 'continueOnFail' is enabled.
Dependencies
- Requires access to binary data helpers for reading binary streams and converting to text.
Troubleshooting
- Common errors include missing or empty text content fields, which result in errors indicating the text content is empty or not a string.
- If the specified input text field is not found in the input JSON, an error is thrown listing available fields to help correct the configuration.
- Errors related to binary data being empty or missing when reading binary files.
- Users should ensure that the input data contains the expected fields and that the text content is properly formatted as a string.