![]() ![]() (1) You mentioned that the 'not secure' macro may run into problem that the end position may not be restored correctly after replace, could you give an example to show? I tried both macro and they all ran fine in my simple example. Man, this is fast, I really appreciate your help. But most regular expression characters are inside interpreted as normal characters. Note: The asterisk * inside is interpreted always as normal character and not as regular expression character. If you want to understand the regular expressions, look into help of UltraEdit for page Regular Expressions on the table for the UltraEdit Syntax. Note: The macro property Continue if search string not found must be checked for both macro versions. The modified block in the temporary file is then cut and pasted over the still existing selection in the main file.Īfter all blocks are reformatted the new file created just for the replaces is closed without saving it. Whenever the 2 main finds select a block in the main file, it is copied via user clipboard 9 to the new file where the replaces are done.Ī replace all does not change the cursor position and therefore 1 Top after Paste is enough. If first opens a new file where all the replaces for a block are done. Key HOME is not a really good method to restore the correct end position for the selection, especially if the line below the block starts with spaces or tabs and you have configuration setting Home Key always Goto column 1 not enabled as I have. Therefore further replaces on the selection can run not on the same block and the result could be not what you would expect.Ī fast but not secure macro is following:īut if this macro works or not depends on the line below the selected block and how large the selected block is and how many bytes are inserted by every replace. The problem is that when replacing something in a selected block which modifies the number of selected bytes the end position of the selection is not correct restored after the replace. Well, now we need some regular expression replaces. Press the button Close and confirm updating the macro with Yes.Press Ctrl+V to replace the first 3 lines with the macro code copied from the browser window.Do not select the last line which contains the macro command for your configured regular expression engine. Select in the left macro code edit field the first 3 macro commands.If you see now the post macro dialog press the button Cancel. Click on Macro - Record, enter a macro name, disable the "Cancel" option, but enable the " Continue if search string not found" option and press button OK.Start UltraEdit and open your file with the data.Copy the macro code above from your browser window to Windows clipboard. ![]() To create the macro with the code above do following: It does not use a regular expression engine. Use following macro with the macro property Continue if search string not found activated for this macro. I am using a trial version of Ultraedit v13.20, in WinXP environment, line terminator is 'Default'.Īnd I prefer Ultraedit's regular expression. And the search goes on until eof.Īlso, please allow me to add additional info about my version of Uedit here: But it would be okay if the macro can convert to either the above or like (Notice that the conflict may be in here as there are indeed 2 /* */ groups within a line. Then skip 'Var1' as it's not inside any of /*. Perhaps I should restate that "I need to add a string "TC" at the end of each line between /* and */ INCLUSIVELY." ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |