用於計算多個 Zip 內的總檔案數的實用程式?

用於計算多個 Zip 內的總檔案數的實用程式?

在 Windows 7 上,我有 120 個 Zip 文件,每個 Zip 都包含映像。

有沒有任何實用程式或軟體可以讓我確認所有 120 個 Zip 中總共有多少張影像?

答案1

你可以嘗試這樣的命令:

rar -t *.zip |find /i ".jpg" /c

-t測試檔案(並列出文件)
find以獲取文件名中包含的所有文件.jpg並對/c它們進行計數

答案2

此 PowerShell 腳本將計算.jpg該資料夾及其子資料夾中所有 Zip 檔案中的檔案數:

$ZipRoot = 'C:\Path\To\Folder'
$Count = 0

$ZipFiles = Get-ChildItem -Path $ZipRoot -Recurse -Filter '*.zip'

$Shell = New-Object -ComObject Shell.Application

$Results = foreach( $ZipFile in $ZipFiles ){
    $Count += $Shell.NameSpace($ZipFile.FullName).Items() |
        Where-Object { $_.Name -match '\.jpg$' } |
        Measure-Object |
        Select-Object -ExpandProperty Count
    }

Write-Host "Count= ", $Count

答案3

.jpg使用某些 Linux shell 來計算目前資料夾中多個 zip 內的檔案總數(可在 Windows 上存取):

find . -maxdepth 1 -type f -name '*.zip' -exec unzip -l {} \; | grep -c '\.jpg$'

例如,如果資料夾包含:

a.zip
123.zip
test.zip
[...]

答案4

用於計算多個 Zip 內文件總數的實用程序

一個可以用7-拉鍊(免費)。在Windows資源管理器中選擇所有存檔文件,右鍵-> 7-Zip -> 測試存檔:

在此輸入影像描述

在此輸入影像描述

相關內容