I want to extract everything under that top folder, but not create that top folder when extracted. So, for example, I could make a folder named "blah", and 7z would extract just the contents under that top folder, to the "blah" folder.
Is there a cline switch that does this?
TIA
Last edit: J. Scott Elblein 2021-12-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the clarification, but unfortunately, renaming folder.tar to topFolder.tar does not help (even if I rebuild the .tar instead of simply renaming it).
In fact, I'm now finding that -t* no longer brings up the content of topFolder, even when I switch back to folder.tar - topFolder is now the only object in test no matter what I do.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
-t* is not related to tar at all. -t* allows to open top level format from vmdk or vhd instead of default smart nested archive open operation.
-spe is working with -oname switch.
If root folder in archive has same name as last part name in -opath\name switch, it will remove that root dir part.
So you will have no duplication name\name\ in extrated paths.
It's common case in 7-zip usage.
You have folder name with files.
You select that folder and create name.tar from that foder.
And then you extract name.tar no default name path (that uses -oname switch).
So we needed that eliminate feature (-spe) to eliminate that duplication of name for that most common case.
Last edit: Igor Pavlov 2023-01-31
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Let's see if I can explain this properly ...
When you download most releases from GitHub in .zip format, the contents will look something like this:
I want to extract everything under that top folder, but not create that top folder when extracted. So, for example, I could make a folder named "blah", and 7z would extract just the contents under that top folder, to the "blah" folder.
Is there a cline switch that does this?
TIA
Last edit: J. Scott Elblein 2021-12-05
I just found out that
tar
is now available on Windows. For the setup I outlined below, the following works as desired:This works on
.zip
too. In fact, it also works on.tar.gz
.There is no switch now.
But you can extract folder with full path and then move it with os shell command.
I'm trying to do the same thing with
.tar
files, and I can get halfway there with the following:The problem is that
<top folder>
still appears intest
(files included), even when I do the following:Interestingly,
-t*
does nothing for.zip
files:<top folder>
is the only thing created intest
.@ipavlov are these bugs?
-spe
eliminates top folder if it has same name as name of archive.Thanks for the clarification, but unfortunately, renaming
folder.tar
totopFolder.tar
does not help (even if I rebuild the.tar
instead of simply renaming it).In fact, I'm now finding that
-t*
no longer brings up the content oftopFolder
, even when I switch back tofolder.tar
-topFolder
is now the only object intest
no matter what I do.-t*
is not related to tar at all.-t*
allows to open top level format fromvmdk
orvhd
instead of default smart nested archive open operation.-spe
is working with-oname
switch.If root folder in archive has same name as last part name in
-opath\name
switch, it will remove that root dir part.So you will have no duplication
name\name\
in extrated paths.It's common case in 7-zip usage.
You have folder
name
with files.You select that folder and create
name.tar
from that foder.And then you extract
name.tar
no defaultname
path (that uses-oname
switch).So we needed that
eliminate
feature (-spe
) to eliminate that duplication ofname
for that most common case.Last edit: Igor Pavlov 2023-01-31