Line Reader

Reads lines from a file or URL. Each line will be represented by a single string data cell in a single row. The row prefix and column header can be specified in the dialog.

This node can access a variety of different file systems. More information about file handling in KNIME can be found in the official File Handling Guide.

Options

Type
The selection mode.
  • File: Select a single file.
  • Files in folders: Select a folder and apply filters to select files within it.
Source
The path to the file or folder to select.
Include subfolders
Whether to include subfolders when selecting multiple files within a folder.
Filter by file extension
Enable filtering files by their extension (e.g. 'xlsx;xlsm').
File extensions
Semicolon-separated list of file extensions to include (e.g. 'xlsx;xlsm;xls'). Case-insensitive unless 'Case sensitive (extensions)' is enabled.
Case sensitive (extensions)
Treat the entered extensions as case sensitive when matching.
Filter by file name
Enable filtering by file name pattern with wildcards or regular expression.
File name filter pattern
Pattern for file name filtering. With type 'Wildcard', use '*' and '?'. With type 'Regex', enter a Java regular expression.
File name filter type
Choose how to interpret the file name pattern: wildcard or regular expression.
Case sensitive (names)
Make file name filtering case sensitive.
Include hidden files
Include hidden files in the selection.
Include special files
Include special file types (workflows etc).
Filter by folder name
Enable filtering of folders by name pattern before descending into them.
Folder name pattern
Pattern for folder name filtering. Use '*' and '?' with filter type 'Wildcard'. With type 'Regex', enter a Java regular expression.
Folder name filter type
Choose how to interpret the folder name pattern: wildcard or regular expression.
Case sensitive (folders)
Make folder name filtering case sensitive.
Include hidden folders
Descend into folders that are hidden (if they otherwise pass filters).
Follow symlinks
Follow symbolic links while traversing folders (only relevant when selecting a folder).
File encoding
Defines the character set used to read or write a file that contains characters in a different encoding. You can choose from a list of character encodings (UTF-8, UTF-16, etc.), or specify any other encoding supported by your Java Virtual Machine (VM). The default value uses the default encoding of the Java VM, which may depend on the locale or the Java property "file.encoding".
  • OS default: Uses the default decoding set by the operating system.
  • ISO-8859-1: ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1.
  • US-ASCII: Seven-bit ASCII, also referred to as US-ASCII.
  • UTF-8: Eight-bit UCS Transformation Format.
  • UTF-16: Sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark in the file.
  • UTF-16BE: Sixteen-bit UCS Transformation Format, big-endian byte order.
  • UTF-16LE: Sixteen-bit UCS Transformation Format, little-endian byte order.
  • Other: Enter a valid charset name supported by the Java Virtual Machine.
Custom encoding
A custom character set used to read a CSV file.
Fail on differing specs
If enabled and the specs of the files are different, the node will fail. This option is only relevant when reading multiple files in a folder.
Row header prefix
Specifies the prefix of the row header. The default is "Row" and the resulting row headers are "Row0", "Row1", and so on.
Column header
Select how the column header should be determined.
  • Use first line as column header: The name of the output column equals the first row of the read file.
  • Set column header: The name of the output column can be set manually in the text field below. The default name is 'Column'.
Column header name
The name of the output column. The default is "Column".
Empty line handling
Select how empty lines should be handled.
  • Replace with missing cells: Empty lines will be replaced by a missing cell.
  • Replace with custom text: Empty lines will be replaced by the text entered in the text field below.
  • Skip: Empty lines will be skipped and are not added to the output.
Replacement text
The text to use as replacement for empty lines.
Filter with regular expression
Include in the output only lines matching the provided regular expression pattern. For example '12.*' will only match lines starting with 12 and have zero or more characters afterwards. The default value is '.*' which matches everything.
Append path column
If enabled, the node will append a path column with the provided name to the output table. This column contains for each row which file it was read from. The node will fail if adding the column with the provided name causes a name collision with any of the columns in the read table.
Limit data rows
If enabled, the number of rows which will be read and output by the node is limited to the specified value.

Input Ports

Icon
The file system connection.

Output Ports

Icon
The lines as read from the file(s), each line represented by a single cell in a data row.

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.