Tutorial: Convert 7z to zip [Linux / Windows]

Setup and Modification Tutorials and guides
Post Reply
Haggis
Reactions:
Posts: 132
Joined: Sun Dec 11, 2016 8:52 pm

Tutorial: Convert 7z to zip [Linux / Windows]

Post by Haggis » Mon Jan 09, 2017 8:21 pm

Method for Linux:

In the folder where you have all your 7z files do the following

Make a new sh file called 7z-to-zip.sh

Code: Select all

touch 7z-to-zip.sh
then make it executable

Code: Select all

chmod +x 7z-to-zip.sh
in the file put the following

Code: Select all

#!/bin/bash
for i in *7z
do
  tmpdir=$( basename "${i}" .7z )
  mkdir "${tmpdir}" && pushd "${tmpdir}"
  if 7z x "../${i}"
  then
     if zip -r "../${tmpdir}.zip" * .[^.]*
     then
        popd
        rm "${i}"
     else
        popd
        echo Packing ${tmpdir}.zip failed!
     fi
  else
     echo Unpacking ${i} failed!
  fi
  rm -rf  "${tmpdir}"
done
save it

then to run it just do

Code: Select all

./7z-to-zip.sh

done

Method for Windows

Easy way is to simply use your eternal trial version of WinRAR. Start the program and browse to the folder with the files you want to convert, then click Tools > Convert archives:
01-conv.png
01-conv.png (135.36 KiB) Viewed 2683 times
Now click Compression and change the settings to ZIP and Best compression (we want small files!). Then in the Files tab, Put each file to separate archive, then OK.
Set destination path by clicking Browse, or by typing.
Before starting conversion, you may want to click Save to keep your settings for future conversions. It is also an option to remove the source files, which is done by ticking Delete original archives.
02-settings.png
02-settings.png (157.65 KiB) Viewed 2683 times
Afterwards, change source files and destination path and just keep going!

Much pleasure! :lol:
Last edited by jolny on Mon Jan 09, 2017 10:20 pm, edited 1 time in total.

Post Reply