Decompress Files

This node unpacks and decompresses files from an archive file. The paths to the extracted files are provided in the output table using a path column.

Supported archive formats are:

  • .zip
  • .jar
  • .tar
  • .tar.gz
  • .tar.bz2
  • .cpio
  • .ar
  • .gz / .gzip

Note:This node cannot decompress KNIME artifacts such as workflows. In order to decompress workflows please use a combination of Workflow Reader and Workflow Writer instead.

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

Settings

Read from
Select a file system from which you want to unzip your archive or decompress your snappy file. There are four default file system options to choose from:
  • Local File System: Allows you to delete a file/folder from your local system.
  • Mountpoint: Allows you to unpack and decompress an archive on a mountpoint. When selected, a new drop-down menu appears to choose the mountpoint. Unconnected mountpoints are grayed out but can still be selected (note that browsing is disabled in this case). Go to the KNIME Explorer and connect to the mountpoint to enable browsing. A mountpoint is displayed in red, if it was previously selected but is no longer available. You won't be able to save the dialog as long as you don't select a valid i.e. known mountpoint.
  • Relative to: Allows you to choose whether to resolve the path to an archive file relative to the current mountpoint, current workflow or the current workflow's data area. When selected a new drop-down menu appears to choose which of the three options to use.
  • Custom/KNIME URL: Allows to specify a URL (e.g. file://, http:// or knime:// protocol). When selected, a spinner appears that allows you to specify the desired connection and write timeout in milliseconds. In case it takes longer to connect to the host / write the file, the node fails to execute. Browsing is disabled for this option.
To read from other file systems, click on ... in the bottom left corner of the node icon followed by Add ports and Source file system connection. Afterwards, connect the desired file system connector node to the newly added input port. The file system connection will then be shown in the drop-down menu. It is grayed out if the file system is not connected in which case you have to (re)execute the connector node first. Note: The default file systems listed above can't be selected if a file system is provided via the input port.
File/URL
Enter a URL when decompressing a file specified by Custom/KNIME URL, otherwise enter a path to an archive file. The required syntax of a path depends on the chosen file system, such as "C:\path\to\file" (Local File System on Windows) or "/path/to/file" (Local File System on Linux/MacOS and Mountpoint). For file systems connected via input port, the node description of the respective connector node describes the required path format. You can also choose a previously selected folder from the drop-down list, or select a location from the "Browse..." dialog. Note that browsing is disabled in some cases:
  • Custom/KNIME URL: Browsing is always disabled.
  • Mountpoint: Browsing is disabled if the selected mountpoint isn't connected. Go to the KNIME Explorer and connect to the mountpoint to enable browsing.
  • File systems provided via input port: Browsing is disabled if the connector node hasn't been executed since the workflow has been opened. (Re)execute the connector node to enable browsing.
The location can be exposed as or automatically set via a path flow variable.
Write to
Select a file system to which you want to extract your files. There are three default file system options to choose from:
  • Local File System: Allows you to select a folder on your local system.
  • Mountpoint: Allows you to write to a mountpoint. When selected, a new drop-down menu appears to choose the mountpoint. Unconnected mountpoints are greyed out but can still be selected (note that browsing is disabled in this case). Go to the KNIME Explorer and connect to the mountpoint to enable browsing. A mountpoint is displayed in red if it was previously selected but is no longer available. You won't be able to save the dialog as long as you don't select a valid i.e. known mountpoint.
  • Relative to: Allows you to choose whether to resolve the path relative to the current mountpoint, current workflow or the current workflow's data area. When selected a new drop-down menu appears to choose which of the three options to use.
It is possible to use other file systems with this node. Therefore, you have to enable the file system connection input port of this node by clicking the ... in the bottom left corner of the node's icon and choose Add ports followed by Destination file system connection .
Afterwards, you can simply connect the desired connector node to this node. The file system connection will then be shown in the drop-down menu. It is grayed out if the file system is not connected in which case you have to (re)execute the connector node first. Note: The default file systems listed above can't be selected if a file system is provided via the input port.
Folder
Enter a valid directory path where the files should get extracted to. The required syntax of a path depends on the chosen file system, such as "C:\path\to\file" (Local File System on Windows) or "/path/to/file" (Local File System on Linux/MacOS and Mountpoint). For file systems connected via input port, the node description of the respective connector node describes the required path format. You can also choose a previously selected folder from the drop-down list, or select a location from the "Browse..." dialog. Note that browsing is disabled in some cases:
  • Mountpoint: Browsing is disabled if the selected mountpoint isn't connected. Go to the KNIME Explorer and connect to the mountpoint to enable browsing.
  • File systems provided via input port: Browsing is disabled if the connector node hasn't been executed since the workflow has been opened. (Re)execute the connector node to enable browsing.
The location can be exposed as or automatically set via a path flow variable.
Create missing folders
Select if the folders of the selected output location should be created if they do not already exist. If this option is unchecked, the node will fail if a folder does not exist.
If exists
Specify the behavior of the node in case an output file already exists.
  • Overwrite: Will replace any existing file.
  • Ignore: Will ignore existing files and append a column in the output table which tells, if a file was newly created or not.
  • Fail: Will issue an error during the node's execution (to prevent unintentional overwrite).

Encoding

Guess file name encoding from archive file extension
If selected, tries to guess the encoding for the names of the files to decompress based on file extension of the archive file. For example, it will use UTF-8 for .zip files, CP437 for .arj, and US-ASCII for .cpio. Unfortunately, the encoding cannot always be correctly guessed. If you notice that the names of decompressed files contain '?' characters, then the encoding was wrongly guessed. In this case, uncheck the box and pick the correct encoding.
Encoding
Sets the character set/encoding to use when reading the names of the files to be decompressed. By default, CP437 is chosen, which is used by some .zip files. You can specify any other encoding supported by Java. Choosing "OS default" uses the default encoding of the Java VM, which may depend on the locale or the Java property "file.encoding".

Input Ports

Icon
The file system connection.
Icon
The file system connection.

Output Ports

Icon
Table containing the list of files and folders that have been extracted.

Popular Predecessors

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.