User to user discussion and support for UltraEdit, UEStudio, UltraCompare, and other IDM applications.

Help with writing and playing macros
2 posts Page 1 of 1
I need to select entire column (let's say I have 2500 rows and add two commas). What is the command (btw is there any shortkey for that?) I can do that in a macro file?

I know there's an option of alt+mouse button for selecting lines, but simply expect that is simpler way that lat+MB1+drag 2500 lines
The macro command ColumnInsert ",," with column mode activated using macro command ColumnModeOff inserts two commas from current position of caret in active file to end of file if there is nothing selected in column mode. The command Insert/Fill Columns can be of course also executed manually without or with having something selected in column editing mode.

The Select Range command can be used to create a rectangular selection with automatic enabling column editing mode and making it possible to use next the Insert/Fill Columns command. But Select Range is not available as macro command. However, in a macro it is possible to enable the column mode, position the caret into a specified line at a specified column and select everything up to another line and another column.

Example for selecting in column mode a block from line 1 column 20 to line 2500 column 22 and replacing the selection with two commas.

Code: Select all
GotoLine 1 20
GotoLineSelect 2500 22
ColumnInsert ",,"

Of course the column in line 2500 could be also 20 to select no characters to just insert the two commas at column 20 in exactly the first 2500 lines of the file.

The help of UltraEdit contains details about Select Range, Column Mode, Insert/Fill Columns and other column editing commands.

Other possibilities to insert/replace strings at a specific column in all lines of a file or a selection are using a replace with advanced (gearwheel button) option In column enabled or using a Perl regular expression replace using backreferences. For example a Perl regular expression with search string ^(.{20}) and replace string \1,, finds lines with at least 20 characters and inserts after those 20 characters two commas.
Best regards from Austria
2 posts Page 1 of 1