If I have a text that has numbers in it, is there a simple way to find all examples of the text and insert a letter before?
Let's say I have the numbers 1-25 and I want to replace them with A1, A2, A3, A4...
Currently I am using search and replace, but it's a bit clunky. Using wildcards I search for "<1" (a 1 at the beginning of a word so as not to find the second 1 in 11) and replace it with "A1". Then I do "<2" and replace with "A2" on down the line until I finish with "<9" and replace with "A9". The problem is I have about 30-50 documents to do this to.
I'm wondering if there is a more efficient way where I can essentially tell Word to search for the beginning of the number and insert the letter before no matter whether the first number is 1-9? Luckily the numbers in the text have a special font so I can distinguish them from the words in the text by searching based on font.
I'm not a Word guru by any means, so maybe this is silly. But have you looked creating a Macro to run through the possibilities for you? If you are using Word 2007, you must enable the Developer menu in the options to get to Macros.
You can use regular expressions in Word, I don't know if it will do exactly what you want as I've never used it myself, but you can check here to find out:
Yes, although Word usually makes me make a highly irregular expression :-P
The key is in the link in Covert_Oddity's post; use the form [0-9] to limit the search to numeric characters. You may need to experiment a little to get the result you want, but you can certainly get there.
<[1-9] ought to find all instances of a number starting a line...
R.
ETA: I guess Kirbic already said this, more or less. I'm no expert at word searches but I do edit manuscripts, some of which are scholarly, and I do have to be able to find my way around.
<[1-9] ought to find all instances of a number starting a line...
R.
ETA: I guess Kirbic already said this, more or less. I'm no expert at word searches but I do edit manuscripts, some of which are scholarly, and I do have to be able to find my way around.
R.
You were close. I used <([1-9]) so that I could replace with A\1 where the "1" signifies the string between the (). It worked quite well and it's shortening my workload by quite a bit.
For this kind of stuff, you should look into a good text editor. I use TextPad. It's a free download, but I bought it years ago.
It's kind of hard to edit Word documents in a plaintext editor.
I do it all the time.
ETA: My point was this: If you find yourself doing this kind of heavy lifting regularly, you're better off with a good text editor. Obviously, if you have a Word document with all sorts of formatting already applied, this won't help you. But if you just have paragraphs of text, long lists, or whatever -- with little or no formatting applied -- it's easier to copy the text into a good text editor, do what you need to do, then copy and paste it back into Word. TextPad is good because it has good, robust support for regular expressions and such. It's just a good tool to know about.