D
D
Damian Lewis2018-12-08 17:25:49
Automation
Damian Lewis, 2018-12-08 17:25:49

How to automatically extract the necessary file from the archives?

There are 1500 archives in 7z format. Each archive contains, among other files, a pdf file. Is there a way to automatically extract only the pdf file from all archives?
It takes quite a long time to manually open each archive and extract the desired file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2018-12-08
@DamianLewis

create a list of your archives as a text file, each file on a new line
create a xxx.bat file:

@echo off
for /f %%a in (путь_и_имя_файла_со_списком_файлов) do "c:\program files\7-zip\7z.exe" e "%%a" *.pdf

all pdf will be unpacked into the current directory without directories in the archives, if the file names match, you will be prompted to overwrite, if this is critical, you need to supplement the code, for example, by creating a directory by the name of the archive, for example.
7z.exe x ... - will unpack files with the directory in the archive they are in
for /rc:\dir %%a in (*.7z) do .... - will search for all archives in the c:\ directory dir and its subdirectories (i.e. a file with a list of archives will not need to be created)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question