M
M
Michael Compass2020-04-06 03:02:58
Automation
Michael Compass, 2020-04-06 03:02:58

How to decompress 70K .ZIP files and automatically transfer them to another local drive?

There is a project folder on drive "E" , it contains 70K zip archives, in each of these archives there are many folders and files of this format:

E:\project/6g3der7hehdj.zip/<b>model</b>/gos545trtgf3dysf.txt
E:\project/gtgsr53tfstg7fg.zip/<b>model</b>/6y637hd7o2d3dd.txt
E:\project/rer3wefsfsfsf.zip/<b>model</b>/ferfff43ffw3rwf3dd.txt


Inside the model folder there are txt files, sometimes the names of these txt files can be the same. How to unpack these 70000 archives

to another disk (to disk " F ")? I'm interested in the model folder with everything that is in it.
5e8a71f5cc66e898625945.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Michael Compass, 2020-04-09
@mik777em

I figured it out myself, but thanks for some ideas.
Unpacking is performed using a zip archiver. I wrote this code in the cmd file:

7z.exe x -tzip *.zip -aot "Model\*" -o"F:\Model"
pause

threw the cmd file into the project folder and launched it.
As a result, I received a Model folder on disk F with all the insides that were inside all instances of the Model folder, in all zip archives.

S
Saboteur, 2020-04-06
@saboteur_kiev

You make a script in which you run through each file with a command like:
unzip -o -d f:/ <file.zip> model
due to the fact that there are a lot of files, you need to come up with something with iteration.
If there was bash, I would do it through xargs

R
Roman Mirilaczvili, 2020-04-06
@2ord

In a bat/Powershell script, recursively go through the directory where the archives are located and, one by one, using unzip / 7z / rar, unpack to the desired directory, appending the name of the archive source file to the path. Then all models will be guaranteed to be unpacked and not overwritten.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question