FME Form: 2024.2
Reading from Archive Files
FME can read file or folder datasets stored in a variety of archiving and compression-only files:
Supported archiving files: 7z, 7zip, rar (except v5), rvz, tar, tar.bz2, tar.gz, tgz, zip
Supported compression-only files: bz2, gz
Upon being read, the data is extracted and used just as if it were a normal dataset. FME is able to read data stored directly in an archive file, or within sub-folders.
Defining an archived dataset to be read is as simple as selecting that file from within any of FME’s dataset selection tools.
For example, when adding a reader:
- Select the Format.
- Click the Browse button to open the file browser. In the bottom right of the file browser, select Compressed Files or Archive Files from the filter list.
- Select the file in the file browser and click Open to add the dataset to the reader:
- Click OK to add the reader to the workspace.
Usage Notes
- To read all files of a specified extension at the top level, use [*.<extension>]. For example:
- To read all files of a specified extension at the top level and in folders beneath the top level, use [**\*.<extension>]. For example:
- To read all files of a specified extension that are nested two folders deep into an archive file:
- To read all files of a specified extension under a relative path, use [<relative\path>\*.<extension>]. For example:
- If the file extensions inside an archive are different (for example, png and PNG), use *.* to open all files in the specified path. For example:
- If the format is set, it is not necessary to select individual files from inside the archive file. FME knows which files to read based on the file extension related to the chosen format.
- While it is possible to write archived datasets using the Generic writer, it is not possible to read them using the Generic Reader with the format set to Guess format name from Extension.
- Reading from a password-protected archive file is not supported.
C:\Data\shape-data.7z[*.shp]
C:\Data\shape-data.7z[**\*.shp]
C:\Data\shape-data.zip[*/*/*.shp]
C:\Data\shape-data.7z[canada\lakes\*.shp]
C:\Data\shape-data.7z[*.*]