takeoutphotosanitizer:uncertain_reclassification_workflow_guide
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| takeoutphotosanitizer:uncertain_reclassification_workflow_guide [2026/02/23 17:16] – [1단계 – _Uncertain 목록 추출] hyjeong | takeoutphotosanitizer:uncertain_reclassification_workflow_guide [2026/02/24 17:08] (current) – [1단계 – _Uncertain 목록 추출] hyjeong | ||
|---|---|---|---|
| Line 50: | Line 50: | ||
| Get-ChildItem -LiteralPath $unc -File -Recurse | | Get-ChildItem -LiteralPath $unc -File -Recurse | | ||
| Select-Object FullName, Name, Length, LastWriteTime | | Select-Object FullName, Name, Length, LastWriteTime | | ||
| - | Export-Csv -LiteralPath $out -NoTypeInformation -Encoding | + | Export-Csv -LiteralPath $out -NoTypeInformation -Encoding |
| </ | </ | ||
| Line 135: | Line 135: | ||
| # 작업 디렉토리(= Photos_Backup)에서 실행한다고 가정 | # 작업 디렉토리(= Photos_Backup)에서 실행한다고 가정 | ||
| - | $in = " | + | $in = " |
| $rootMedia = " | $rootMedia = " | ||
| - | $log = " | + | $log |
| # 입력 파일 확인 | # 입력 파일 확인 | ||
| Line 152: | Line 152: | ||
| $logDir = Split-Path -Parent $log | $logDir = Split-Path -Parent $log | ||
| if (!(Test-Path -LiteralPath $logDir)) { New-Item -ItemType Directory -Path $logDir -Force | Out-Null } | if (!(Test-Path -LiteralPath $logDir)) { New-Item -ItemType Directory -Path $logDir -Force | Out-Null } | ||
| + | |||
| + | # 카운터(요약 출력용) | ||
| + | $cnt_total | ||
| + | $cnt_skip | ||
| + | $cnt_moved | ||
| + | $cnt_failed = 0 | ||
| Import-Csv -LiteralPath $in | | Import-Csv -LiteralPath $in | | ||
| ForEach-Object { | ForEach-Object { | ||
| + | |||
| + | $cnt_total++ | ||
| # year_final 정리(공백 제거) | # year_final 정리(공백 제거) | ||
| $yy = ("" | $yy = ("" | ||
| - | if ($yy -notmatch ' | + | if ($yy -notmatch ' |
| # 원본 파일 경로 확인 | # 원본 파일 경로 확인 | ||
| $src = $_.FullName | $src = $_.FullName | ||
| - | if ([string]:: | + | if ([string]:: |
| - | if (!(Test-Path -LiteralPath $src)) { return } | + | if (!(Test-Path -LiteralPath $src)) { $cnt_skip++; |
| + | |||
| + | # 안전장치: | ||
| + | # (대소문자 무시, 경로 구분자 혼용을 감안해 \\ 와 / 모두 허용) | ||
| + | if ($src -notmatch ' | ||
| # 목적 연도 폴더 생성 | # 목적 연도 폴더 생성 | ||
| Line 184: | Line 196: | ||
| try { | try { | ||
| Move-Item -LiteralPath $src -Destination $dst -ErrorAction Stop | Move-Item -LiteralPath $src -Destination $dst -ErrorAction Stop | ||
| + | $cnt_moved++ | ||
| } | } | ||
| catch { | catch { | ||
| $status = " | $status = " | ||
| + | $cnt_failed++ | ||
| } | } | ||
| Line 193: | Line 207: | ||
| $dstLog = ($dst -replace " | $dstLog = ($dst -replace " | ||
| - | " | + | |
| + | | ||
| Add-Content -LiteralPath $log -Encoding UTF8 | Add-Content -LiteralPath $log -Encoding UTF8 | ||
| } | } | ||
| + | |||
| + | # 요약 출력 | ||
| + | Write-Host (" | ||
| </ | </ | ||
takeoutphotosanitizer/uncertain_reclassification_workflow_guide.1771834589.txt.gz · Last modified: by hyjeong
