Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

aoitsukinosuke

macrumors regular
Original poster
Jun 13, 2011
116
0
The title pretty much says it all.

I am using Word for Mac 2011 and use the "Find and Replace" command all the time.

However, I need Word to find an array of repetitive phrases and simply delete them. Is this possible or just wishful thinking?

TIA.
 
I've done that in the past by leaving a space in the 'replace' field. Don't know if that would work for you tho'.

I do that from time to time for other things, either a space or a dot.

I should have expressed myself better. I copy forum threads related to my line of work from Firefox to Word.
There are phrases like "Leave a comment" and they take up a line by themselves. After every reply in the thread, there is this phrase and I end up hundreds of lines with only this phrase. That's what I'm trying to delete. The phrase and the unnecessary line space it takes.

If I replace them with something, anything, the line still stays there.
Hope I've made myself clearer this time.
 
It sounds like you are using the wrong tool. You need to remove carriage returns which is difficult to do using a word processor like Word. Yours is a job for a text editor like the free Text Wrangler.
 
You can use ^p to find a paragraph ending, or ^l for a line ending. So, to remove line feeds you would search for ^l and replace with , that is, replace with nothing. That function has been in MS Word since the DOS versions in the early 1990s. You'll have to experiment to find the best use of these for your requirements.
 
It sounds like you are using the wrong tool. You need to remove carriage returns which is difficult to do using a word processor like Word. Yours is a job for a text editor like the free Text Wrangler.

MisterMe - Thanks for the suggestion. I got Text Wrangler and played with it for a while with no end result. It's definitely me being in unfamiliar territory, but I gave up in the end.

You can use ^p to find a paragraph ending, or ^l for a line ending. So, to remove line feeds you would search for ^l and replace with , that is, replace with nothing. That function has been in MS Word since the DOS versions in the early 1990s. You'll have to experiment to find the best use of these for your requirements.

drambuie - Thank you, but that's not what I'm looking for .
 
MisterMe - Thanks for the suggestion. I got Text Wrangler and played with it for a while with no end result. It's definitely me being in unfamiliar territory, but I gave up in the end.



drambuie - Thank you, but that's not what I'm looking for .

I'm wondering if this could be done with a Macro? It's been years since I used Word that seriously, but I will try later on.
 
Hmm, I can make it work on a per document basis, but can't remember the correct term for "Global" application of a Macro.

The way you record them without actually coding is to press the record button, then perform the actions you want to achieve, then stop the recording an save the macro with an appropriate file name for use on the documents you want.

But at the moment, I'm stuck.
 
Hmm, I can make it work on a per document basis, but can't remember the correct term for "Global" application of a Macro.

The way you record them without actually coding is to press the record button, then perform the actions you want to achieve, then stop the recording an save the macro with an appropriate file name for use on the documents you want.

But at the moment, I'm stuck.

MacMan45 - Thanks for your time.

I went to your link and then clicked "Creating a macro with no programming experience using the recorder" which gave me the exact instructions as yours.

Being a complete stranger to macros, I'll fiddle around between work and see if I can do something.

If I do, I'll post it here. If not, I'll wait for you.

Thanks again. You're cool. :D
 
The title pretty much says it all.

I am using Word for Mac 2011 and use the "Find and Replace" command all the time.

However, I need Word to find an array of repetitive phrases and simply delete them. Is this possible or just wishful thinking?

TIA.

Just use textedit...
 
Just use textedit...

Thessman - To do??? What can I do with Textedit that I can't do with Word?

I want to simply perform a Find & Delete, instead of Find & Replace.
Does Textedit have that capability? If yes, I'd appreciate it if you could direct me.
 
Maybe I didn't make my suggestion clear enough. Find and Replace is functionally identical to Find and Delete if you enter nothing into the Replace field. Everything that matches the Find criteria will disappear. If a complete line is to be deleted, and you end the Find criteria with ^l (caret+lower case L), that entire line and the space it occupies will disappear, and the rest of the document will move up one line. If you're going to end up with unneeded double spaces, enter ^l twice at the end of the Find phrase.
 
Maybe I didn't make my suggestion clear enough. Find and Replace is functionally identical to Find and Delete if you enter nothing into the Replace field. Everything that matches the Find criteria will disappear. If a complete line is to be deleted, and you end the Find criteria with ^l (caret+lower case L), that entire line and the space it occupies will disappear, and the rest of the document will move up one line. If you're going to end up with unneeded double spaces, enter ^l twice at the end of the Find phrase.

drambuie - Thank you. I followed yr advice and got halfway thru.

Please bear with me.
I'm trying to delete "Share" along with the line it occupies. (as you put it correctly)
I went to Edit>Find>Replace.
When I enter "share" in Find and leave Replace blank, it deletes "share" but leaves a blank line there.

But, I can't get the deleting line part to work.
If I enter "share^l" in Find, nothing happens. If I enter "share" in Find and enter "^l" in Replace, still the word is gone but the empty line is there.

Where am I going wrong?
 
drambuie - Thank you. I followed yr advice and got halfway thru.

Please bear with me.
I'm trying to delete "Share" along with the line it occupies. (as you put it correctly)
I went to Edit>Find>Replace.
When I enter "share" in Find and leave Replace blank, it deletes "share" but leaves a blank line there.

But, I can't get the deleting line part to work.
If I enter "share^l" in Find, nothing happens. If I enter "share" in Find and enter "^l" in Replace, still the word is gone but the empty line is there.

Where am I going wrong?

I make a guess (without seeing what you are doing) that Word is not getting that the characters you are typing are meant to be interpreted. In the F/R dialog box, click on the "more" button to see the search options, then use the "special" button to enter the symbol you want to look for--line or paragraph break.
 
Thessman - To do??? What can I do with Textedit that I can't do with Word?

I want to simply perform a Find & Delete, instead of Find & Replace.
Does Textedit have that capability? If yes, I'd appreciate it if you could direct me.

Open a copy of your file in textedit, press alt cmd f, enter your search criteria in the "find" field ( you can insert line breaks etc. by clicking on the little arrow beside the magnifying glass in the "Find" field ) and leave the replace field empty. Press the "all" button and you're done.
 
MacCruiskeen - I inserted ^ as a special character instead of typing. Not a change.

FYI - My Word 2011 doesn't have a More option or a special button.

Thessman - What you suggest only deletes the word, not the line itself and we've already covered that with drambuie. Thanks for your time.
 
In TextWrangler, Search->Find... Enter "\r" to search for carriage returns, and replace with " ", without the quotes. I just tried it, and it works.
 
In TextWrangler, Search->Find... Enter "\r" to search for carriage returns, and replace with " ", without the quotes. I just tried it, and it works.

rbrian - I wrestled with TextWrangler following MisterMe's post. Not my cup of tea.
Thanks for the suggestion.
 
MacCruiskeen - I inserted ^ as a special character instead of typing. Not a change.

FYI - My Word 2011 doesn't have a More option or a special button.

Thessman - What you suggest only deletes the word, not the line itself and we've already covered that with drambuie. Thanks for your time.

Just copy the whole line with the word and the line break and paste it in the find field. Works for me anyway...
 
Just copy the whole line with the word and the line break and paste it in the find field. Works for me anyway...

Line break?

Is this what you mean? "Share ^l"

----------

I make a guess (without seeing what you are doing) that Word is not getting that the characters you are typing are meant to be interpreted. In the F/R dialog box, click on the "more" button to see the search options, then use the "special" button to enter the symbol you want to look for--line or paragraph break.

I found it.
Edit>Find>Advanced Find and Replace

But doesn't work as you thought it would.
Boy, all this help from you nice people and I can't seem to get it going.
 
rbrian - I wrestled with TextWrangler following MisterMe's post. Not my cup of tea.
Thanks for the suggestion.

TextWrangler's manual has an entire chapter on GREP that will show you how to write regular expressions to find and manipulate just about anything. There are third party add-ons that extend word to support regex as well, but not free ones as far as I know.
 
I found it.
Edit>Find>Advanced Find and Replace

But doesn't work as you thought it would.
Boy, all this help from you nice people and I can't seem to get it going.
Turn on the ¶ mode (Show all non printing characters), so your document shows all the hidden characters as a symbol, like space and return. Then it is easier to highlight and copy them into the Advanced Replace window. Just leave the "Replace with" field blank to delete, don't put a space in there or anything, just blank. I've been doing this in Word and Excel since the early 90s, almost daily. If you do this enough, you'll get used to how it works and you won't need the ¶ mode, anymore.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.