7-Zip

Is there a way to use 7zip in Knime?

Hey,

in the node repository you find a Zip Files and an Unzip Files node under IO->File Handling->Zip. For the Unzip Files node the supportet formats are:

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

What exactly do you want to do and does this information already help?

Cheers,
Marten

1 Like

Hi,
any news about this topic?

I have a folder with around 300 7zip files and I need to extract a specific file from each one.
The “Decompress Files” node doesn’t support 7zip format.

Many thanks,
Gery.

Hi @Gery , do you absolutely need to decompress the files via Knime? If not, alternatively, you could decompress these files via the command line like this:
cd <path_to_your_folder>
"<path_to_your_7z.exe" e *.7z
for example:
cd c:\zipped_files
"C:\Program Files\7-Zip\7z.exe" e *.7z

e is for extract, and *.7z will target all files with extension .7z in that folder (.7z is the usual 7zip compressed file extension. If they’re .zip files, then use *.zip instead)

3 Likes

Many thanks @bruno29a, it could be a walkaround.

In the 7z files there are many files. I need to extract only 1 file from each archive (the file name is always the same).

There is a way to extract onlya specific file?

Thanks again,
Gery.

Hi @Gery , yes you can extract specific file, and also files using wildcard.

For example:
"C:\Program Files\7-Zip\7z.exe" e *.7z *.txt
or
"C:\Program Files\7-Zip\7z.exe" e *.7z ThisFileOnly.exe

Be careful though of name collision, that is if you are extracting the same file from each of the zipped file. If that is the case, you may want to do a loop instead, where you would extract each file at a time, and renaming it so that the name does not collide - I don’t know what files you are dealing with, so I can’t see any pattern.

3 Likes

Many thanks @bruno29a

It works fine!

Gery

1 Like

No problem @Gery , glad to help, and glad that it worked.

You can also use IZARC (http://www.izarc.org). For 300 files it may be much faster.

IZArc is an external utility. Does someone know if there are new KNIME’s nodes to fix it?

Hi @diegozabalab and welcome to the forum.

The Decompress Files node doesn’t support 7zip format yet, but we do have a ticket in our system for that (AP-19004). I can add a +1 on that ticket from you.

3 Likes