A favorite title can be set for each saved search/replace favorite. In
Find and Replace window a click on button with star symbol and click next on opened context menu on
Edit favorites. Select the saved favorite search/replace string and enter below
Favorite title the wanted title string listed finally in submenu
Favorites of context menu opened on clicking on button with star symbol.
But I honestly use the search/replace string favorites only as
templates for often needed expressions always adapted after selection to what is currently needed because all the find/replace parameters are not saved with the search/replace string favorites.
I recommend to record a find/replace often needed with same parameters into a macro. Let's assume you are using already an UltraEdit version with ribbon interface and the ribbon mode is also used by you and not toolbar/menu mode with contemporary or traditional menus.
- On (last) ribbon tab Advanced click in fourth ribbon group Macro on down arrow right to item Record and click in popup menu on Define and record. The Macro Definition dialog opens.
- Enter as macro name for example Count lines. Uncheck the macro property Show cancel dialog for this macro. The second property does not matter for this macro running just one Find in Files.
- You could also define a hotkey or a chord (multi-key hotkey) to later run this macro by key. Then click on button OK.
- Run now Find in Files with the appropriate parameters recorded by UltraEdit into the macro.
- On (last) ribbon tab Advanced click in fourth ribbon group Macro on item Stop to stop macro recording.
- Click next on down arrow right to item Configure and click in pop-up menu on Save all macros. The Save Macro dialog opens.
- It is up to you where the macro file is stored. It can be any directory on which you have read/write access. I recommend using directory %APPDATA%\IDMComp\UltraEdit (copy and paste this string into file name field and hit enter to open this directory) into a new subdirectory Macros created by clicking on symbol button Create New Folder or right clicking into the list of folders and files and clicking in context menu in submenu New on menu item Folder. Navigate into new folder Macros.
- Enter as name for the macro file whatever you want. I suggest as macro file name AutoLoaded.
- On (last) ribbon tab Advanced click in fourth ribbon group Macro once again on down arrow right to item Configure and click in pop-up menu on Set macro for auto-load. The Save Macro Auto Load on Startup dialog opens.
- Browse to just saved macro file if this is necessary because of just saved macro file is not automatically selected as macro filename. Click on button OK.
Now the macro file
%APPDATA%\IDMComp\UltraEdit\Macros\AutoLoaded.mac just saved and configured is automatically loaded by UltraEdit on startup. This macro file can contain multiple macros. So you can record or write from scratch more macros at any time and save them all into this macro file loaded on startup of UltraEdit.
There are multiple methods to run a macro:
- The macro can be executed by pressing hotkey/chord on having defined one.
- It is also possible to click on (last) ribbon tab Advanced in fourth ribbon group Macro on down arrow right to Play macro in pop-up menu on Play any multiple times, select macro Count lines and execute it.
- There is on ribbon tab Layout in second ribbon group Views the check box item Macro list opening the Macro List view listing all macros in currently loaded macro file AutoLoaded.mac on which the macro Count lines can be executed with a double click on it. The Macro List view can be configured to be docked on any side of UltraEdit main application window with auto-hide (pin symbol) turned on to have this list always available with moving mouse pointer over its tab without the need to open in first via ribbon tab Layout.
- And depending on used version of UltraEdit the macro Count lines could be also added to a custom ribbon tab or to a toolbar on using toolbar/menu mode for quick execution by mouse.
Last but not least it would be also possible to code this simple Perl regular expression
Find in Files as UltraEdit script which is added to the
Script List for quick execution by hotkey/chord, from
Script List or a custom ribbon tab or a customized toolbar with the pointing device. A scripting solution could do more than just running the
Find in Files as it could process the results written to output window or new file and reformat the results using regular expressions to get finally in output window or in a new file or in clipboard just the data you want in format you would like.
Of course the same is possible with a macro with the exception that a macro cannot access the output window content. So the
Find in Files must be executed with results written to an edit window processed further with the macro with regular expression replaces to wanted data format kept finally in new file or copied to clipboard and closing new file without saving it.
Conclusion: Getting a line statistic
exactly as you want it is possible with writing an UltraEdit script or recording/writing an UltraEdit macro which can be configured for easy execution by hotkey/chord or using pointing device at any time or even automated using a batch file which calls UltraEdit with the parameters to run the macro or script producing the statistic data file.