2013-04-11 27 views
0

很多時候我需要將文本文件從UCS-2 Little Endian編碼爲ANSI,並將其保存爲相同的名稱。這個過程是否可以自動化?例如要運行Notepade ++的參數,或使用特殊的腳本?記事本中的autoencode ++

+0

您是否嘗試過記事本++宏功能? – 2013-04-11 12:03:17

回答

0

我已經在5000多個文件上完成了這項工作。我用的AutoHotkey在文件列表窗口發送鍵擊

  1. ,按文件名輸入所以它會在記事本+ +開放
  2. 後記事本++被激活並準備好,觸發轉換在記事本
  3. 密切文檔++
  4. 切換到文件列表窗口
  5. 發送向下箭頭前進到下一行

我已暫時禁用語法着色(我有Visual Basic文件)以更快地打開文件。

我的宏在Total Commander使用文件列表(而不是Windows資源管理器)(WINKEY + F5)是:

SendMode Input 
DetectHiddenWindows, On 
SetTitleMatchMode, RegEx 

#F5:: 
    KeyWait,AppsKey 

    Loop, 10 { 
     MouseGetPos, xpos, ypos 
     If (xpos == 0) 
      Break 
     Send {F4} 
WaitNPP: 
     Sleep, 20 
     IfWinNotActive, .*Notepad 
      ;MsgBox nax 
      Goto, WaitNPP 

     Send !c 
WaitDialog: 
     Sleep, 50 
     IfWinNotActive, .*Column 
      Goto, WaitDialog 

     Send {Esc} 
     Sleep, 50 
     Send ^+{F8}^s^w 
     ;!+F8 was created as custom shortcut in N++ 
     Sleep, 100 
     Send #1 
WaitTC: 
     Sleep, 20 
     IfWinNotActive, .*Commander 
      Goto, WaitTC 

     Send {Down} 
     ;Run C:\Tools\notifu.exe /p "Conversion to UTF-8" /m "1 of 10" /d 500 
     ;Sleep, 500 
    } 
Return 

循環設置爲處理10個文件。

Inside Notepad ++我按下了Ctrl + Alt + Shift + F8這是我在記事本++裏設置的。