List zip file's contents using 7zip command line with non-verbose machine-friendly output
Is there a way, in windows, to use 7z.exe's list command such that the copyright heading, file information, and column headers are skipped and you're left with just a terse machine-readable list of files within the archive?
Right now I get this
>7z.exe l Test.zip
7-Zip [64] 9.38 beta Copyright (c) 1999-2014 Igor Pavlov 2015-01-03
Listing archive: Test.zip
--
Path = Test.zip
Type = zip
Physical Size = 29966218
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2015-11-01 23:52:49 ....A 14887917 14256660 01 - Bitter Sweet Symphony.mp3
2015-10-30 22:45:48 ....A 16567208 15709214 06 - Hallelujah.mp3
------------------- ----- ------------ ------------ ------------------------
2015-11-01 23:52:49 31455125 29965874 2 files
Kernel Time = 0.000 = 0%
User Time = 0.000 = 0%
Process Time = 0.000 = 0% Virtual Memory = 2 MB
Global Time = 0.010 = 100% Physical Memory = 6 MB
What I want to see is just this:
>7z.exe l Test.zip
2015-11-01 23:52:49 ....A 14887917 14256660 01 - Bitter Sweet Symphony.mp3
2015-10-30 22:45:48 ....A 16567208 15709214 06 - Hallelujah.mp3
7z v15.xx introduced some new switches:
-
-slt
- show technical information forl
command -
-ba
- suppress headers; undocumented.
The output with these switches set looks like this:
D:\TruLaLa> 7z l -ba -slt test.7z
Path = 2.msi
Size = 2005506
Packed Size = 638340
Modified = 2009-04-16 23:00:00
Attributes =
CRC = B6FFF2FF
Encrypted = -
Method = LZMA:3m
Block = 0
Path = 1.doc
Size = 35328
Packed Size =
Modified = 2008-12-06 23:00:00
Attributes =
CRC = C041B41F
Encrypted = -
Method = LZMA:3m
Block = 0
...
Path = 2+.log
Size = 303250
Packed Size =
Modified = 2015-03-13 18:57:32
Attributes = A
CRC = 5C738A96
Encrypted = -
Method = PPMD:o32:mem192m
Block = 1
...
Path = 3.txt
Size = 0
Packed Size = 0
Modified = 2015-10-13 01:46:41
Attributes = A
CRC =
Encrypted = -
Method =
Block =
This format is definitely more readable for us, robots.)