Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to find and replace a word such as banana and then I'd like to add the number 1 to the first word, number 2 to the second, and No. 3 to the third and so on. there is an easy way or do I manualy enter 1, 2, 3 behind every word?

share|improve this question
3  
What are you really trying to accomplish? Do you really want a file with those word/count combinations, or are you looking for counts separate from something else? I can't think of an easy, non-programmatic way to do what you're looking to do. Depending on the file structure, you may be able to do something via Excel. –  ernie Jul 2 '13 at 0:18
    
In Word? I think you are going to have to find a script / VBA or macro to do this. –  AthomSfere Jul 2 '13 at 0:32
add comment

2 Answers

Here’s an answer that’s maybe not as easy as you wanted but not as bad as you feared:

  • Go to a blank line and type SEQ fruit..  (You can actually use any identifier instead of fruit.)  (Note: based on your configuration of Word, it may or may not be important to put a non-alphanumeric character, such as a period, after fruit.)
  • Select the SEQ fruit (but not the period) and press Ctrl+F9.  Curly braces should appear, and it will turn gray.
  • I’m a little unclear on the question: are you trying to replace the bananas with “banana1”, “banana2”, …, or are you trying to replace them “apple1”, “apple2”, …?  Whatever; go to the beginning of the line (to the left of the {) and type the text that you want (e.g., “apple” or “banana”).
  • Select everything up to (but not including) the period and type Ctrl+X.  Delete the period (and the line, if you created it just for this).
  • Search for “banana”.  When you find it, type Ctrl+V.
  • Alternate typing Shift+F4 and Ctrl+V until you run out of bananas.
  • Select the entire document (Ctrl+A is good for this) and press F9.
share|improve this answer
    
Wow, +1 for making Word look geeky cool. Could you explain what Ctrl+F9 and F9 alone do exactly? Or the SEQ keyword? Can I now refer to SEQ fruit somehow? –  terdon Jul 2 '13 at 0:59
    
@terdon: (Ctrl)+(F9) turns the selected text into a field. The more GUIish way of inserting fields is by Insert (tab) –> Text (group) –> Quick Parts. There are about 100 field types –– try it with PAGE or NUMPAGES, for example. SEQ generates sequential numbers (like figure numbers). I believe that you can refer to SEQ values with REF fields. (F9) is “Update Field”, which is like Refresh in a browser or a spreadsheet –– get current values. (It can also be used to update/refresh a Table of Contents.) If you look in the Word help, you’ll find tons of more information. –  Scott Jul 2 '13 at 1:14
    
Thanks, but I do all my typesetting in LaTeX, I was just wondering what the esoteric shortcuts were and I thought the OP might be as well. Thanks for the explanation. –  terdon Jul 2 '13 at 1:20
add comment

I would use the combination of both Word and an automator. You can use something like GhostMouse or Remouse to record your mouse and keyboard movements.

  1. Word Document open on one part of the screen, notepad opened with the number 1..N listed.
  2. Cut the first row to clipboard with the next row at top now.
  3. Find/Replace in Word.
  4. Type search text
  5. CTRL + V and type the search text again
  6. Return
  7. Go To Step 2 until completed
  8. If space is needed then do Find/Replace search text and replace with Space along with the search text

This is the quickest way to do this in my opinion. Always make sure you save a backup of your document prior to doing this.

A couple of side notes. GhostMouse and Remouse is pretty much the same. However, I've had better luck with Remouse Free Version as I can change the number of repeats and the speed in which the playback executes. With ReMouse, you can save your script and then open it in notepad. Copy and paste the entire contents multiple times so that you have one script which is doing several repeats. Remouse offers 3 free repeats before it will stop the script. This kind of gets around that.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.