Profile Display Attributes Race/Clan/Gender
Miqo'te Seeker of the Sun / ♀
Nameday
30th Sun of the 5th Umbral Moon
Guardian
Azeyma, the Warden
Grand Company
Immortal Flames / Flame Private Third Class
AttributesStrength 380 Dexterity 381 Vitality 378 Intelligence 377 Mind 440
Offensive PropertiesCritical Hit Rate 412 Determination 420 Direct Hit Rate 412
Defensive PropertiesDefense 748 Magic Defense 1488
Physical PropertiesAttack Power 380 Skill Speed 412
CraftingCraftsmanship 1841 Control 1701
LEVEL 96
Character Profile 検索文字列入力 $k = Read-Host "検索文字列を入力" 検索対象フォルダ $base = "C:\CSV" 出力ファイル $out = Join-Path $PSScriptRoot "result.csv" $err = Join-Path $PSScriptRoot "error.csv" 初期化 if (Test-Path $out) { Remove-Item $out } if (Test-Path $err) { Remove-Item $err } CSVファイル取得 $files = Get-ChildItem $base -Recurse -File -Filter *.csv -ErrorAction SilentlyContinue foreach ($f in $files) { $n = 0 try { Get-Content $f.FullName -ReadCount 1000 -ErrorAction Stop | ForEach-Object { foreach ($line in $) { $n++ if ($line -like "$k") { '"{0}",{1},"{2}"' -f $f.Name, $n, ($line -replace '"','""') } } } } catch { # エラー内容付きで別ファイルへ出力 '"{0}","{1}"' -f $f.FullName, ($.Exception.Message -replace '"','""') | Add-Content $err } } | Set-Content $out Write-Host "完了:" Write-Host "結果: $out" Write-Host "エラー: $err" @echo off powershell -NoProfile -ExecutionPolicy Bypass -File search.ps1 pause Range("A1:A10").Copy Range("B1").PasteSpecial xlPasteValues Application.CutCopyMode = False