Reputation: 81
I want to list all the files/folders in an archive in the 7-Zip command line and exclude '*' in the list by regular expression, to recognize the folder count in the first level of the archive(like xxx\ or xxx, but not xxx\abc).
like the list of the archive, need to match the last three, and then exclude them, also keep the first one:
xxx<br>
xxx\123.txt
xxx\abc
xxx\abc\456.pdf
I try to use like this 7z l archive.zip -x!*\*
, but it will exclude the first one xxx\
.
Update:
I use *\?*
temporarily to filter the outputs.
Upvotes: 0
Views: 709
Reputation: 11822
z-zip does not use regex nor os wildcards it has a very limited switch filename range that is simplified.
The primary issue is that although a zip file, in some incarnations, may contain an empty folder entry, most do not, they simply store the filenames with their prior path names thus there is no folder-name independent of all those file wildcard entries to be listed.
So the answer itself to your dilemma is to filter the fuller filenames output for the text you require. Probably much easier done than said on Linux, but a pain in the for loops on windows.
Upvotes: 1