Count with Find and Replace

Find and Replace is a quick way to do some counting in your text.

 

Count with Find and Replace
Mac Tip #270/22-Nov-2006

A reader reminded me that Find and Replace is a quick way to do some counting in your text. For example, perhaps you need to count how many times you’ve used a particular word — did you mention Product A as often as you mentioned Product B? Or perhaps you’d like to make sure you closed all the brackets you used.

Call up the Find and Replace dialog box for your software and enter your Search term, perhaps Apple, then put the same term in the Replace section. You’re replacing a word with the same word.

Now click Replace All. Most software gives you some kind of acknowledgement of how many replaces it made — perhaps as a simple count in the still open Find and Replace dialog box, or maybe in a separate alert, as you can see in the screenshots.

Be careful though: watch out for words embedded in other words. If you need to count how often you’ve used the word ‘the’, then you should include a space after it, otherwise the program may also count anything where those letters appear consecutively such as in ‘there’, ‘either’ or ‘clothes’. Even the trailing space may not be sufficient, for some Blithe Spirits.

Next week: Replace in technicolour.

Thanks for reading. Remember to tell your friends about MacTips. Subscribe for regular Tips.

Clip to Evernote

Tell us what you think.
Note: your comment is not published straight away. I check and approve all comments, otherwise the spammers get a free rein. I usually check comments within 24 hours.

* 1 comment… read it below and tell us what you think.

Denis Wederell 24 November 2006 at 08:09:43

Not a comment, but a question. How do I find m2 and replace with m2 (showing the 2 in superior posiion)?

Reply

Add your Comment

Take Control ebooks (affiliate link) are superb.
I do some of my best learning from them. Buy through my link so I can make more and better Tips.

Take Control of Using Lion.   Buy Take Control of iCloud.  Macworld iPhone 4S Superguide   Take Control of iTunes 10: The FAQ, Second Edition