作者vernc (cralvin)
看板EZsoft
標題[請問] 多文件用regexp替換的軟體?
時間Mon Jan 19 15:12:30 2015
例:d:\temp下有1000多個html檔
現在想用自訂的regexp規則替換內容
像ultraedit這些都需要開啟檔案才能替換
但開啟幾千個……
請問有什麼tool能用regexp批次處理完全部檔?
thx
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.175.222.177
※ 文章網址: https://webptt.com/m.aspx?n=bbs/EZsoft/M.1421651552.A.57E.html
1F:推 timeline: EmEditoru有 "在檔案中取代" 可以指定批次處理路徑 01/19 15:31
2F:→ oversky0: dnGrep 01/19 15:32
上面兩個試過是只能列模式
<td class="td_listcell_r1c2">1</td>
<td class="td_listcell_r1c3">2</td>
<td class="td_listcell_r1c1">3</td>
<td class="td_listcell_r1c4">4</td>
像下這個.*r1c4\"\>4\<\/td\> 想砍掉全部四行就不行,只會砍第四行
還是能改那選項做到上面?thx
※ 編輯: vernc (111.242.34.230), 01/19/2015 18:25:05
3F:→ SilentWorld: EmEditor 符合需求阿,你好像REGEXP下錯了吧 01/19 19:05
4F:→ quamtum: .*r1c4\"\>\d\<\/td\> 試試 01/19 20:07
5F:→ rick65134: ultraedit好像可以多檔案搜尋或取代耶 01/20 14:13
最後自已寫vbs處理
本來是用fso作的,發現日文會亂掉改用adodb.stream
tmp=Trim(TrageTextFile.ReadLine)
請問fso版的這行在adodb.stream該怎麼做呢
.ReadLine的adodb.stream版是什麼?thx
※ 編輯: vernc (111.242.27.39), 01/20/2015 20:11:35
6F:推 HZYSoft: 用 sed 指令可以很簡單的作到,功能非常強大 01/22 20:34
8F:→ HZYSoft: 可以同時指定多條 regexp rules 做取代 01/22 20:35
9F:→ HZYSoft: 搭配 cygwin + bash 模擬UNIX shell 就更猛了 01/22 20:36
10F:→ HZYSoft: 還可以跟 shell script 結合,非常順手 01/22 20:36