For a more timely answer, you might consider the SlickEdit forums on slickedit.com, but I'll try here.
I would load the file in a buffer, and create a macro along the following lines:
- Create a while loop incrementing a counter
- In the while loop, use
search
with regular expressions to find the next occurrence - When the next occurrence is found, use
search_replace
to replace the string found with a new string composed using the counter variable, and to repeat the previous search - When nothing is to be found any more, terminate the loop
Without testing it on an XML file, this should give you a start for your function (assuming you know how to create a macro file and load it into SE), a quick test showed it to work on a plain text file, no guarantees, however:
/* Demo for StackOverflow question 14205293 */
_command my_renumber() name_info(','VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL)
{
int not_found = 0; /* boolean to terminate loop */
int iLoop = 0; /* Counter to renumber items */
/* Use search initially; if that call doen't find an item, we're done. */
if (search('blah_:i', 'R') != 0)
{
not_found = 1;
}
while (!not_found)
{
if (search_replace('blah_' :+ iLoop, 'R') == STRING_NOT_FOUND_RC)
{
not_found = 1;
}
iLoop++;
}
}