Normally different lengths of the lines is no problem if nothing is on right side of the column where a number should be inserted in a block. For example if you have something like this (from a resource file):
- Code: Select all
#define IDB_OUT_DISABLED |
#define IDB_OUT_ENABLED
#define IDC_CHANGED_CURSOR
#define IDC_CURVES_CURSOR
#define IDI_BB_EVENTLIST
#define IDR_VC
#define IDD_ABOUTBOX
#define IDD_ALREADYPERMITTED
#define IDD_BB_SLAVE_MISSING
#define IDD_CALIBRATE
All to do is set the cursor in the first line to column + 1 of the longest line. In the example above this position is marked with
| which is column 30 as indicated in the status bar at bottom of the UltraEdit window.
Now enable the column mode, hold SHIFT and select the lines in this column with the cursor keys. You can use also the mouse. Then run
Column - Insert Column. With 2000 as First Number you get now:
- Code: Select all
#define IDB_OUT_DISABLED 2000
#define IDB_OUT_ENABLED 2001
#define IDC_CHANGED_CURSOR 2002
#define IDC_CURVES_CURSOR 2003
#define IDI_BB_EVENTLIST 2004
#define IDR_VC 2005
#define IDD_ABOUTBOX 2006
#define IDD_ALREADYPERMITTED 2007
#define IDD_BB_SLAVE_MISSING 2008
#define IDD_CALIBRATE 2009
Turn off the column mode. If the multiple spaces are no problem, you are finished. If you want to get this
- Code: Select all
#define IDB_OUT_DISABLED 2000
#define IDB_OUT_ENABLED 2001
#define IDC_CHANGED_CURSOR 2002
#define IDC_CURVES_CURSOR 2003
#define IDI_BB_EVENTLIST 2004
#define IDR_VC 2005
#define IDD_ABOUTBOX 2006
#define IDD_ALREADYPERMITTED 2007
#define IDD_BB_SLAVE_MISSING 2008
#define IDD_CALIBRATE 2009
set the cursor to start of the first line or select the block. Next press Ctrl+R to open the replace dialog. Enable the option
Regular Expressions. If the regular expression engine is
Perl or
Unix search for "
[ \t]+([0-9]+)$" and replace it with "
\1" in the current file or only the selected text using button Replace All. If the regexp engine is UltraEdit, search for "
[ \t]+^([0-9]+)^$" and use "
^1" as replace string. The search and replace strings you have to copy are without the double quotes! The preceding single space in the replace string is important.