Hi,
I'm sure this has been covered somewhere before... but my searches didn't give any useful results.
I am trying to edit a collection of XML documents that have variable length words that I want to replace with the same word;
words are formatted as: "User-#", or...
"User-##", or...
"User-###"
where "#" is an integer number from 0-9.
All words are (planned) to be replaced with "User-2".
Each method I've tried leaves me with a new word that that is made of the replacement word + all the original #'s from the original word.
Can anyone help?
Thanks,
Fred
How to find variable length words...
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
SOLVED - How to find variable length words...
OK.
I think I've found, at least a work around if not the best answer. Due to the fact that my data is fairly homogeneous, I can submit the following FINDs in this order...
1. Find "User-[0-9][0-9][0-9]" --> execute
2. Find "User-[0-9][0-9]" --> execute
3. Find "User-[0-9]" --> execute
Of course, with runs 2 and 3, I'm actually re-editing previous edits, but it ends with the intended replaced text in all files.
*Still interested if there's a better way (single pass?) to do this.*
Thanks,
Fred
I think I've found, at least a work around if not the best answer. Due to the fact that my data is fairly homogeneous, I can submit the following FINDs in this order...
1. Find "User-[0-9][0-9][0-9]" --> execute
2. Find "User-[0-9][0-9]" --> execute
3. Find "User-[0-9]" --> execute
Of course, with runs 2 and 3, I'm actually re-editing previous edits, but it ends with the intended replaced text in all files.
*Still interested if there's a better way (single pass?) to do this.*
Thanks,
Fred
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm