How do I convert my existing zip files to 7z with 7-zip comand line?

1

2

I'd like to convert a couple thousand zip files to 7z, with maximum compression and multithreading enabled.

Also in another place. Like c:\temp\file.zip to f:\converted\file.7z

Grumpy ol' Bear

Posted 2011-07-18T19:23:53.997

Reputation: 5 313

Answers

3

You can use arepack (included in atool command suite) to convert between archive formats. Combined with a little bash, it makes easy to convert a bunch of ZIP files to 7z:

for f in *.zip; do arepack $f $f.7z; done
rm *.zip

jesjimher

Posted 2011-07-18T19:23:53.997

Reputation: 770

3You can use --each/-e to let arepack do the iteration for you: arepack --each --format=7z *.zip – Joel Purra – 2017-01-25T16:51:14.670

1@JoelPurra the arepack-only solution is best! Thanks – Matt Sephton – 2018-06-21T11:20:12.160

1

Nevermind, http://www.peazip.org/ does the job just fine!

Edit: But hell, it takes way too long....

Grumpy ol' Bear

Posted 2011-07-18T19:23:53.997

Reputation: 5 313

And it also can't handle some zips that contain filenames in "bad" encodings like cp1251 or koi8r or something like that. – Sergey – 2013-07-15T10:09:32.610

0

I wrote a script in Python - https://raw.github.com/pashinin/scripts/master/zip27z.py You can run it with:

./zip27z.py your_archive.zip

and it will create your_archive.7z near it.

Or you can install it on your system with make install (if you see the repo)

And just call:

zip27z your_archive.zip

It needs unzip and 7za programs.

You can modify it as you wish for your needs (and send me a pull request)

Sergey

Posted 2011-07-18T19:23:53.997

Reputation: 469