$p = "C:\Users\Acer\Desktop\ttt.xlsx"
Add-Type -AssemblyName System.IO.Compression.FileSystem
$z = [IO.Compression.ZipFile]::OpenRead($p)
$results = @()
# Читаем текстовые значения Excel
$shared = @()
$e = $z.GetEntry("xl/sharedStrings.xml")
if ($e) {
$r = [IO.StreamReader]::new($e.Open())
[xml]$sx = $r.ReadToEnd()
$r.Close()
foreach ($si in $sx.SelectNodes("//*[local-name()='si']")) {
$shared += (($si.SelectNodes(".//*[local-name()='t']") |
ForEach-Object { $_.InnerText }) -join "")
}
}
# Проверяем все листы
foreach ($e in $z.Entries | Where-Object {
$_.FullName -match '^xl/worksheets/sheet\d+\.xml$'
}) {
$r = [IO.StreamReader]::new($e.Open())
[xml]$sx = $r.ReadToEnd()
$r.Close()
foreach ($c in $sx.SelectNodes("//*[local-name()='c']")) {
$v = $c.SelectSingleNode("./*[local-name()='v']")
if (!$v) { continue }
$value = $v.InnerText
$type = $c.GetAttribute("t")
$match = $false
if ($type -eq "s") {
$value = $shared[[int]$value]
}
if ("$value" -match '10[./-]11[./-]2026') {
$match = $true
}
if ($type -ne "s" -and $value -match '^\d+(\.\d+)?$') {
if ([double]$value -ge 46336 -and [double]$value -lt 46336) {
$match = $true
}
}
if ($match) {
$results += [PSCustomObject]@{
File = $p
SheetXML = $e.FullName
Cell = $c.GetAttribute("r")
Value = $value
Type = $type
}
}
}
}
$z.Dispose()
Write-Host "`nВСЕ НАЙДЕННЫЕ СОВПАДЕНИЯ:" -ForegroundColor Green
$results | Format-Table -AutoSize -Wrap
Write-Host "ВСЕГО СОВПАДЕНИЙ: $($results.Count)" -ForegroundColor Cyan
$results | Export-Csv "$env:USERPROFILE\Desktop\ttt_results.csv" -NoTypeInformation -Encoding UTF8