Search and replace with term list? -
i wonder if there program can use list of terms want replace instead of take 1 one.
example
à=À â=â â=Â å=å å=Å ã=ã ã=Ã
thank in advance
i use ultraedit , powergrep atm.
ultraedit has 2 features automating reformatting tasks: macros , scripts.
see ultraedit forum topic when use scripts on macros brief overview of differences.
ultraedit macro
an ultraedit macro can created recording replaces manually once on file or code them directly in edit/create macro dialog.
a manual creation done follows:
- click in ultraedit in menu macro on menu item edit macro.
- click on button new macro.
- enter macro name example
replaceentities
. - uncheck macro property show cancel dialog macro.
- let macro property continue if search string not found checked.
- assign hotkey or chord quick execution key if wanted quick macro execution key in future.
- click on button ok.
- back in edit/create macro, there new macro selected 3 lines present in edit field macro commands:
insertmode
columnmodeoff
hexoff
- below 3 macro commands must added reformatting task macro code lines posted below.
- click on button close , confirm question update macro button yes.
the macro ready usage
- by assigned hotkey/chord,
- by double clicking on in macro list opened via view - views/lists - macro list in case of not being visible (docked or floating), or
- by using macro - play any/multiple times.
also macro - play again can used depending on macro last time executed.
the macro code required additionally 3 standard commands present in dialog replace in entire active file html entities example:
top ultraeditreon find matchcase "à" replace "À" find matchcase "â" replace "â" find matchcase "â" replace "Â" find matchcase "å" replace "å" find matchcase "å" replace "Å" find matchcase "ã" replace "ã" find matchcase "ã" replace "Ã"
it necessary save ue macro (without or other ue macros) macro file using macro - save all.
for using macro (and other macros store in same macro file) later again, necessary load macro file using macro - load.
with macro - set auto load possible select macro file being automatically loaded on startup of ultraedit macros in macro file available beginning without explicit loading of macro file.
the macro properties can changed later using macro - delete macro/modify properties. don't forget use macro - save all after making change macro code or properties save change in macro file, too.
ultraedit script
ultraedit scripts make use of javascript core engine. ultraedit script ascii/ansi text file containing javascript core code additional ultraedit related scripting commands. means ultraedit script can written directly other text file , must not edited in dialog.
an ultraedit script makes same macro above be:
if (ultraedit.document.length > 0) // file opened? { // define environment script. ultraedit.insertmode(); ultraedit.columnmodeoff(); ultraedit.activedocument.hexoff(); // move caret top of active file. ultraedit.activedocument.top(); // define parameters several replace in entire active file. ultraedit.uereon(); ultraedit.activedocument.findreplace.mode=0; ultraedit.activedocument.findreplace.matchcase=true; ultraedit.activedocument.findreplace.matchword=false; ultraedit.activedocument.findreplace.regexp=false; ultraedit.activedocument.findreplace.searchdown=true; ultraedit.activedocument.findreplace.preservecase=false; ultraedit.activedocument.findreplace.replaceall=true; ultraedit.activedocument.findreplace.replaceinallopen=false; ultraedit.activedocument.findreplace.selecttext=false; // property available since ue v14.10. if (typeof(ultraedit.activedocument.findreplace.searchincolumn) == "boolean") { ultraedit.activedocument.findreplace.searchincolumn=false; } ultraedit.activedocument.findreplace.replace("à","À"); ultraedit.activedocument.findreplace.replace("â","â"); ultraedit.activedocument.findreplace.replace("â","Â"); ultraedit.activedocument.findreplace.replace("å","å"); ultraedit.activedocument.findreplace.replace("å","Å"); ultraedit.activedocument.findreplace.replace("ã","ã"); ultraedit.activedocument.findreplace.replace("ã","Ã"); }
such ultraedit script should saved file extension .js, example replaceentities.js
.
once ue script saved, can added via scripting - scripts script list adding short description script , assigning hotkey/chord script quick execution key.
the script ready usage
- by assigned hotkey/chord,
- by double clicking on in script list opened via view - views/lists - script list or scripting - script list in case of not being visible (docked or floating), or
- by clicking on script file name in menu scripting.
if ue script active file , written run not on active document, script can executed scripting - run active script. scripts 1 above written run on active file , therefore requires adding script file script list execution.
the core objects , functions of javascript not documented anywhere within ultraedit although can used in ultraedit scripts. documentation core features can found on mozilla developer site.
the additional scripting commands of ultraedit documented in of ue on page title scripting commands. there additionally view - views/lists - tag list containing tag groups ue/ues script commands , ue/ues macro commands quick adding scripting or macro command of ue in active file @ current position of caret.
Comments
Post a Comment