作者perist ()
看板EZsoft
標題Fw: [請問] 如何合併大量文字檔且含檔名?
時間Sun Apr 27 17:00:49 2014
※ [本文轉錄自 ask 看板 #1JNBkysF ]
作者: perist () 看板: ask
標題: [請問] 如何合併大量文字檔且含檔名?
時間: Sun Apr 27 16:11:38 2014
上千個文字檔要合併成一個
且不止內容要合併 檔名也要包含在內
就是以檔名為分界的意思
有什麼辦法?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 42.71.124.220
※ 文章網址: http://webptt.com/m.aspx?n=bbs/ask/M.1398586300.A.D8F.html
1F:推 dcfgh:請人幫你寫個小程式吧 04/27 16:19
※ 發信站: 批踢踢實業坊(ptt.cc)
※ 轉錄者: perist (42.71.124.220), 04/27/2014 17:00:49
2F:推 hirokofan:理論上可以用echo+type處理,但是以前我測試的結果是 04/27 17:08
3F:→ hirokofan:type似乎會漏字orz 04/27 17:09
4F:→ perist:可以指點一下嗎 我有研究cmd指令 不過完全超過我能力範圍 @ 04/27 18:03
5F:→ perist:@ 04/27 18:03
6F:→ perist:我Google到了 問題已解決 雖然我完全看不懂為什麼 = = 04/27 18:17
7F:→ perist:for %I in (*.txt) do @echo ====%~nxI >>allfiles.txt && 04/27 18:18
8F:→ perist:type "%~nxI" >>allfiles.txt 04/27 18:19
9F:→ perist:感謝提供關鍵字 04/27 18:19
10F:推 hirokofan:echo是叫出字串,type是列出文字檔,%~nxI是丟進for迴圈 04/27 21:59
11F:→ hirokofan:的檔名,你可以用for/?去看。>>allfiles.txt是繼續寫入 04/27 22:01