┌ __ __ ┐
|\:i:`丶、 ⌒V{ } /⌒\_、 ''~i/i|
|:i:i:i\i__∧ ‘, / { ノ -ミ:i:i:i:i|
i|:i:i:i/⌒V .....:'"~ ̄ ̄~"'':..... { Y:i:i|i _
八_ノ\ _、 ''~:i:i:i:i/:i:i:i:i:i:i:i:i:i:i:i:i:i:i`丶、人 八:i:i:<__
厂 /:i:i/:i:i/:i:i:i:i:i:i:i:i:i:i:i:i:|:i:i:‘,:i:i:i:`、 ∨__:i:i:i:i:i:i:\
乂__/:i:i:i:/:i:i/:i:i:|:i:i:i:i:i:i:i:i:i:i:i|:i:i:i:‘,:i:i:i:i‘,__ノ:i:i:i:\ ̄\〉
:i:i/:i:i:i:i:i:i:i/:i:i:i:|i:i:i:i:i:i:i:i:i:i:i厂ミ:iハ:i:i:i:i:ヤiヤ:i:i:i:i:i`、
:i:i:i:i:i:i:i|i:i/|:i:i:i/|i:i:i:i:i:i:i:i/i/ 丶|:i:i:i:i:|:i:|i:i:i:i:i:i:i:i:',
|:i|:i:i:i:i:i|/''^~~^''ト|:i:i:i:i:/i/''^~~^'' |:i:i:i:i:|:i:| :i:i:i:i:i:i:i:‘,
|:i|:i:i:i:i:i抖尖ミk、 |:i:i:i/i/ 抖尖ミk、i:i:i:i:i|:i:゙‘,:i:i:i:i:i:i:i:‘,
|:i|:i:i:i:i圦 _)/ハ `|:i:/|/ ´ん'ハ ノ:i:i:i:i:|/ ‘,:i:i:i:i:i:i:i:‘,
. ノ:i|:i:|:i:i:i| 乂rソ |/ 乂rソ |:i:i:i:i:|: ‘,:i:i:i:i:i:i:i:‘,
/⌒|:i:|:i:i:i|. , |:i:i:i:i:|: ゚。i:i:i:i:i:i:i:i:.
i|:i:|:i:i:i∧ /:|:i:i:i:i:|i: ゚。:i:i:i:i:i:i:i:,
八i:i:i:i:i|公 ` ´ .イ |:i:i:i:i八 、i:i:i:i:i:i‘,
\i:i| ⌒〕h。, _、rf〔⌒ :|:i:/ `、:i:i:i:i:‘,
\ /(} ≧ ≦ {)、 / _、、_ `、:i:i:i:‘,
√ ̄~"'' _,,、イ `丶 / \ _ /-‐-ミ `、:i:i:i:゚。
{ / /八 __∧∧__ /ハ V }: \:i:i:゚。
_/} ̄~"''7 √_「: : : : :[_]: : : : : Y'ヤ ヤ''^~ ̄{、 \:i:i:.
/ニニ√ ′√-|___、 ''~ニ〕iト。,__|-ヤ ヤ `Yハ ゚。\:i:.
. |ニニニ八 .′√.ニ<__/ニニ\__>ニヤ ヤ 丶 ノ_∧ ゚。:i:\\
i|ニニニニY :辷辷辷辷辷辷辷辷辷_} :: Yニニ∧ ゚。:i:i:i\\
八ニニニニ八 l l l l ノニニニ-_ ‘,:i:i:i:i:`、:i:.
/ニ--=ニニニ:ーl l l lイニニニニニ〉 ‘,:i:i:i:i:i:`、i:,
/ニニ=-\-=ニノヤl l l l√ニニニ-/ |:i:i:i:i:i:i:i:i:‘,
_-ニニニニニ/~ ̄ ヤ, , ,゙ _√ニニ_、イ |:i:i:i:i:i:i:i:i:i:‘,
〈ニニ=- -=〈 ヤ ′ ,゙ ,_√ニ ̄ニニ√ |:i:i:i:i:i:i:i:|i:i:i:.
. ∨ニニニニ- {∧ ‘, / /-{|ニニニニ| |:i:i:i:i:i:i:i:|i:i:i:|
. ∨ニニニニ∧ _Y=‐- __ -‐=Y |ニニニニ| ノ:i:i:i:i:i:i:i:|i:i:i:|
∨ニニニニ∧ 「 |´^''=‐- -‐=''^`{ .|ニニニニ| /:i:i:/|:i:i:ノ:i:i:ノ
# 1. index.html 열어서 ID Title Username 전체를 액셀에 복붙
# 2. 특정 어장명 or 어장주명 기준으로 정렬해서 ID 리스트를 메모장 파일에 복붙
# 3. 어장 Title 리스트를 메모장 파일에 복붙. ANSI 양식으로 저장할 것.
# 4. 하기의 2가지 코드를 Powershell을 통해 순서대로 실행
-----------------------------------------------------------------------------
# 1. Powershell 설정 (이 부분을 본인의 경로로 수정하세요)
$listPath = "D:\list.txt" # 폴더 번호가 적힌 메모장 위치
$sourceDir = "D:\anchor" # 아카이브 폴더가 있는 곳
$destDir = "D:\정리용" # 옮길 목적지
# 2. 목적지 폴더가 없으면 생성
if (!(Test-Path $destDir)) { New-Item -ItemType Directory -Path $destDir }
# 3. 메모장을 읽어와서 반복 복사 실행
Get-Content $listPath | ForEach-Object {
$folderName = $_.Trim() # 공백 제거
$srcPath = Join-Path $sourceDir $folderName
$dstPath = Join-Path $destDir $folderName
if (Test-Path $srcPath) {
Copy-Item -Path $srcPath -Destination $dstPath -Recurse -Force
Write-Host "$folderName 복사 완료" -ForegroundColor Green
} else {
Write-Host "$folderName 폴더를 찾을 수 없습니다." -ForegroundColor Yellow
}
}
-----------------------------------------------------------------------------
# 1. Powershell 설정 (이 경로들을 본인의 환경에 맞게 수정하세요)
$targetDir = "D:\정리용" # 복사된 폴더들이 있는 상위 경로
$list2Path = "D:\list2.txt" # 어장 Title이 적힌 메모장 경로.
$outputFile = Join-Path $targetDir "Index_With_Title.html"
# 2. 설명문 파일 읽어오기 (배열로 저장)
if (Test-Path $list2Path) {
$descriptions = Get-Content $list2Path
} else {
Write-Host "설명문 파일(list2.txt)을 찾을 수 없습니다." -ForegroundColor Red
return
}
# 3. HTML 시작 태그 및 스타일 (설명문을 위한 스타일 추가)
$htmlHeader = @"
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>상세 설명이 포함된 폴더 리스트</title>
<style>
body { font-family: 'Malgun Gothic', sans-serif; line-height: 1.6; padding: 30px; background-color: #f9f9f9; }
h1 { color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 10px; }
table { width: 100%; border-collapse: collapse; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
th, td { padding: 12px 15px; border: 1px solid #ddd; text-align: left; }
th { background-color: #3498db; color: white; }
tr:nth-child(even) { background-color: #f2f2f2; }
a { text-decoration: none; color: #3498db; font-weight: bold; }
a:hover { color: #2980b9; text-decoration: underline; }
.folder-num { color: #7f8c8d; font-size: 0.9em; }
.description { color: #e67e22; font-weight: 500; }
</style>
</head>
<body>
<h1>📂 폴더별 콘텐츠 및 설명 목록</h1>
<table>
<thead>
<tr>
<th style="width: 20%;">폴더명</th>
<th style="width: 30%;">파일 링크</th>
<th style="width: 50%;">상세 설명</th>
</tr>
</thead>
<tbody>
"@
$htmlFooter = " </tbody>`n </table>`n</body>`n</html>"
# 4. 각 폴더를 돌며 HTML 파일과 설명을 매칭
$tableRows = ""
$folders = Get-ChildItem -Path $targetDir -Directory | Sort-Object {[int]$_.Name} # 숫자 순서대로 정렬
$index = 0
foreach ($folder in $folders) {
# 해당 순서에 맞는 설명 가져오기 (설명이 부족할 경우 빈칸 처리)
$currentDesc = if ($index -lt $descriptions.Count) { $descriptions[$index] } else { "" }
$htmlFiles = Get-ChildItem -Path $folder.FullName -Filter "*.html"
foreach ($file in $htmlFiles) {
$relativePath = "./$($folder.Name)/$($file.Name)"
$tableRows += " <tr>
<td><span class='folder-num'>$($folder.Name)</span></td>
<td><a href='$relativePath' target='_blank'>$($file.Name) 열기</a></td>
<td><span class='description'>$currentDesc</span></td>
</tr>`n"
}
$index++ # 다음 폴더를 위해 인덱스 증가
}
# 5. 파일 저장
$finalHtml = $htmlHeader + $tableRows + $htmlFooter
$finalHtml | Set-Content -Path $outputFile -Encoding UTF8
Write-Host "----------------------------------------------" -ForegroundColor Green
Write-Host "설명이 포함된 리스트 생성이 완료되었습니다!" -ForegroundColor Green
Write-Host "결과 파일: $outputFile" -ForegroundColor Cyan
Write-Host "----------------------------------------------" -ForegroundColor Green