プロフィール
パラメータ表示Attributes
| STR | 380 |
|---|
| DEX | 381 |
|---|
| VIT | 378 |
|---|
| INT | 377 |
|---|
| MND | 440 |
|---|
Offense
| クリティカル | 412 |
|---|
| 意思力 | 420 |
|---|
| ダイレクトヒット | 412 |
|---|
Defense
Melee
Crafting
LEVEL 96 調理師

自己紹介
検索文字列入力
$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