Page 1 of 1
sandr
Posted: Fri Oct 19, 2001 6:56 pm
by iclbloom
Is there a way to use sandr (or other cmd) to change the first occurrence of a pattern to "x" and the second occurrence of the same pattern to "y" and so on.
Thanks
Leon Bloom
sandr
Posted: Fri Oct 19, 2001 9:14 pm
by John
Yes, although the best way may depend on what you want the x and y to be. A '+' in the replacement string will put an incrementing number, if you want x to be 1, y to be 2 etc.
The other option would be to use <fmtcp sandcall> which allows a Vortex function to be called each time the pattern is matched. It can use a variable to keep track of how many times it has been called, and behave appropriately. You can use <capture> around that if you need the results in a variable rather than output to the screen.