I have various .7z files
(.7z file)
FolderA
FolderB
FolderC
File1
File2
FolderD
File3
...
I simply want to extract FolderC from the archive.
It is impossible in 7-Zip.
I tried with:
7z x "A/B/C/*" -o"MyPath"
This should create:
MyPath/File1
MyPath/File2
MyPath/FolderD
MyPath/FolderD/File3
But this creates MyPath/A/B/C/D
It's very bad.
I cannot simply extract a subdirectory inside the archive 7z.
7z e does not work, because that throws everything into a jumbled mess in one folder.
7z x does not work, because that creates an entire hierarchy A/B/C/D when I only wanted to extract C.
I am annoyed, frustrated, wasting hours with mv
and rmdir
adding hundreds of extra lines into my shell scripts and ruining my script files, just to fix a problem because 7-Zip is incapable of such basic functionality for extracting a subdirectory.
Yes, console 7-Zip seems to lack a switch for dropping leading directories. A feature request for that has been made recently. Strangely, 7-Zip File Manager is able to do what you want, but you cannot automate that.