The task at hand is to iterate through files, select <proc thru </proc> and number the <step1 items like this...<step1 label="1".
I am able to iterate through the <step1>s successfully using the following:
However, I can't figure out how to segregate the <proc thru </proc> where the file may have 2 or more <proc>s.
Any ideas?
I am able to iterate through the <step1>s successfully using the following:
Code: Select all
UltraEdit.ueReOn(); /* Use UE regexp syntax */
UltraEdit.activeDocument.findReplace.regExp = true;
UltraEdit.activeDocument.findReplace.replaceAll = false;
UltraEdit.selectClipboard(9);
// First go to top of document
UltraEdit.activeDocument.top();
var NumberValue = 1; /* Start value */
while ( (UltraEdit.activeDocument.findReplace.find("<step1")) && ! UltraEdit.activeDocument.isEof() ) {
//Make loop depend on presence of <step1 and break at End-of-file
UltraEdit.activeDocument.findReplace.replace("<step1","<step1 label=\""+NumberValue+"\"");
NumberValue++; /* Increment the numbering */
}
// reposition to top after renumbering
UltraEdit.activeDocument.top();
UltraEdit.selectClipboard(0);
However, I can't figure out how to segregate the <proc thru </proc> where the file may have 2 or more <proc>s.
Any ideas?