I have a directory with multiple .tarfiles that have multiple files .zip. The tree structure is somewhat similar:
testDirectory
-tarArchive.tar
-directory1
-zipArchive11.zip
abc.XML
1.TIF
2.TIF
...
-zipArchive12.zip
xyz.XML
a.TIF
b.CDX
...
.
.
.
-directory2
-zipArchive21.zip
...
-zipArchive22.zip
...
.
.
.
.
.
I need a separate batch of script to recursively retrieve only .XMLfrom each .zipwhile maintaining the tree structure (first, all .zipwill be extracted from the main .tar, and then only .XMLfrom each .zip). In addition, processed archives must be deleted subsequently.
I can achieve most of this code.
for /R "C:\Users\frozenfyr\Desktop\test" %%I in ("*.zip", "*.tar") do (
"C:\Program Files\7-Zip\7z.exe" x -y -o"%%~dpI" "%%~fI" && del "%%~fI"
)
except for 2 things:
I can not extract only files .XML.
"C:\Program Files\7-Zip\7z.exe" x -y -o"%%~dpI" "%%~fI" "*.zip" -r
XML
"C:\Program Files\7-Zip\7z.exe" x -y -o"%%~dpI" "%%~fI" "*.XML" -r
( ) , .tar.
-
"C:\Program Files\7-Zip\7z.exe" x -y -o"%%~dpI" "%%~fI" "*.zip" "*.XML" -r
.tar .
script .zip, (
).
powershell script, . , script . SU, /. -x switch .
, SO SU, Google , , . , SO SU , , . SO , .
, , ..