Link to home
Start Free TrialLog in
Avatar of Stephen Kairys
Stephen KairysFlag for United States of America

asked on

Word 2016 - Wild card method to search for "ing" word at beginning of sentence?

Hi,

For editing my novel, I'm looking for sentences that begin with a word (verb) ending in "ing". e.g.

"Smiling, she reached for her wine."
"Gaining speed, he passed three other runners."

The pattern here would be.
<Capital letter><one or more characters><"ing">

Can Word's wildcard feature handle such a search?

Thanking you, ;)
Steve
Avatar of Paul Sauvé
Paul Sauvé
Flag of Canada image

use Find
select Use wildcards box
click on Special button
select End of word >
type ing BEFORE the > character
now click on Find next
User generated image
There is an Advanced Find and it finds an occurrence but highlights everything to the occurrence so seems to have some limitations.

User generated image
Avatar of Stephen Kairys

ASKER

Paul and John,
Sounds like a start. But, can we enhance the above to specify that the word starts with a capital letter? Thanks.
I spent some time on this and cannot find a way to isolate the wanted letters. That is because the preceding part could be anything. Try without wildcards , but then the find results could be anywhere in the document
@John,
Why do you think that finding results "anywhere in the document" or "highlighting everything" would be an issue? Maybe I didn't phrase my question clearly? The point of this exercise is to find all --ing words that begin a sentence throughout the entire novel. The initial capital letter is needed so it will ignore something like "He was walking down the road...."

Thanks.
Because Word does not know what is on front or at the end so if finds everything up to. I tried several times and it works the same way every time.  I cannot make it isolate a space (because spaces are legitimate) so it finds everything up to, at least in my attempts thus far
have to agree with John - Word does not know if the word ending with ing is at the beginning, middle or end of the sentence. i also tried several ways to do this with no joy!

by highlighting all the words ending with ing, then you will at least see those that are at the beginning of a paragraph
OK, I'll settle for highlighting. So, now a question.

@John - in the FIND WHAT field, you have >*ults. What's the purpose of the * ?  
And how do I enable highlighting?

Thanks.
I was using that as a test to find the word endings in ults so results
OK, got it. But, when I tried >*ing, it found a phrase e.g.

"hovered overhead, looming:

When I did ing> it seems to find only whole words.

And, I got the highlighting to work....it highlights the "ing" in any word ending with "ing", but in gray. Can I make it yellow or green?

Thanks!
To the latter point, I do not know how (of if) you can change the highlighting colour.
OK, let me play around with that. I could swear I tried highlighting some time back and it was yellow, but I could be wrong.

John, I want to give you credit for this question, so would you be able to repost your original comment using ing> instad of >*ults?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Daryl Bamforth
Daryl Bamforth
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey Daryl,
I'll try your suggestion in a bit. Thank you for this idea.

What is the purpose of having both [a-z] and @ ?
@ allows you to search for 1 or more occurrences of the previous character or match.

So if you had
lo@t

Open in new window


It would match 'lot' and 'loot', in your case you are wanting a word that is the beginning of  a sentence (starting with a capital letter) and so we first match on any word that begins with a capital letter. If however we were to put @ after this we would only search for words that were all capital letters, ie TRAINING. Instead we now match on a lower case letter. We could continue this on using multiple [a-z]'s but that would only match exactly on how many we put in.

If you had
<[A-Z][a-z][a-z][a-z][a-z]ing>

Open in new window


You could match on Training (Match on 'Train' + ing) but not Sing (match on S fail on missing 4 additional lower case letters). As we don't know how long the word is going to be we use @, this will match any word from Sting to Uncompromising, but not flailing as it doesn't begin with a capital letter.

And whilst typing this out just realised it's limitation in terms of 4 letter words, So you will need another search just for them
<[A-Z]ing>

Open in new window


As to your yellow highlighting, if you use the Advanced find window it will highlight it in grey, if you use the Navigation search document it will highlight all matches in yellow.
OK, makes sense. I'll try it in a bit.

Wondering: Would it not match something like "Ruing"?  Since the @ means "1 or more" not "0 or more" ?  "He was ruing the turn of events..."

Thanks.
It would match that as the u is the 1st occurrence.

User generated image
Hmm, give me a few mins, thought of a way to fix it, testing now.
<[A-Z][a-z]@ing>

Open in new window


@Daryl  - the above found no matches, in the FIND dialog box. Do I need to use the Navigation pane? If so, how do I access it? Thanks.
I think you will find that the navigation pane leads to the same advanced find
Bah Microsoft doesn't have any wildcard for 0 or more matches, unfortunately, so will need to be 2 searches, 1 for 4 letter words, 1 for more than 4 letters.

Can you supply a bit of text you are expected text?

I just ran it against

"Smiling, she reached for her wine."
"Gaining speed, he passed three other runners."
And it matched the first word in both sentences.

What version of word are you using?
I was using Word 2016 and I think Steve is as well
CTRL + F will bring up navigation windows, or just clicking the 'find' (not the down arrow)  button once.
Yes but the find underpinnings are the same in the end (at least in my system)
It does, but Navigation will highlight all occurrences in a document. Advanced Find will 'Find Next' occurrence either up or down.

Stephen, sorry I misread your comment. It will work in either find method. Did you remove the '1:' from the command? That is added by the forum software when you list a line of code.

For instance

Line 1
Line 2

But when wrapped in code tags becomes
Line 1
Line 2

Open in new window


I have attached a screenshot of the Advanced find working.
User generated image
Please look at this screenshot and attached docx. Still not working for me. (Word 2016.)
User generated image
No rush on responding, as I'm getting ready to head out to dinner.

PS- Daryl, did you mean two commands would be needed if I need to handle words like "Ruing"? If so, no big deal, such verbs are few and far between, at least in my novel. :)

Thanks, everyone!
IngTest.docx
You need to tick use wildcards.

No 1 for 4 letter words (Ring, Sing) 1 for more than 4 letter words (Ruing, Bring).
Even when I did that (way back here) it did not work for me. I think it is a basic limitation of the Word 2016 Find.
@John, sorry can you elaborate? Which bit didn't work for you? Ticking Use wildcards?
Yes. I set up a search with Wildcards and the advanced function and it search from the beginning to the point of my find. That is what Paul and I posted earlier. I have not really been able to progress past that even though trying different things.
@John. Both of my screenshots are showing the matches from the string, don't know why yours wouldn't be working.
I must have missed something in my test. If I go back to <[A-Z][a-z][a-z][a-z][a-z]ing> in my search, it DOES work and goes back just to the beginning of the word where it found "ing"  So that part works better than a simple advanced search.
@Daryl - Yes! Checking the Wildcard box seems to work. Will test it further tomorrow or Monday.

Btw, I realized my parameters are not perfect per ING words starting a sentence. If your text has (e.g.) the name of a business such as
"The Running Store", "Running" will generate a match. But, I can deal with these exceptions.

Thanks again.
No problem. Once you have wildcard ticked it will work in 'Navigation' find as well (which will find all occurrences and highlight them yellow, navigate using the 'Results' tab) as well as, very helpfully, telling you how many matches it found.

Enjoy :)
Thanks. Please remind me, how do i activate the 'Navigation' tab?

Also, is there a way for Word to "remember" this esoteric "Find" criteria so I don't have to type it each time?
Just using CTRL+f or click the 'Find' Button.

It should remember it in the find history, if you click the drop down arrow next to the field (in advanced find) it will show you your find history
OK, I'm in the FIND dialog via CTRL-f. But, the dropdown shows nothing.
You need to pull down the little arrow to get the advanced functions to enter what you want (only in Advanced)

User generated image
The basic Find / Advanced Find is all the same structure no matter how you approach it.

Then as Daryl has mentioned, used the Find History to remember the construct. I would write it down in case History vanishes. I was not aware of the very advanced find construct either.
@John,
I never see the Navigation Pane. I vaguely recall that I disabled it a long time ago...maybe I need to change some option? Thanks.
In Word, in the Ribbon, click on Find and the Navigation Pane opens. Or use Ctrl-F as Daryl notes.
Hmmm...OK I went to FIND --> ADVANCED FIND and all I see this the below.

User generated image
OK, will check back later today. Off to volunteer at the NYC Marathon. :)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Couple screenshots to hopefully clear things up.

Note, you can click the word 'Find'. You don't have to click the down arrow and then select Find. Please ignore the typo .. I couldn't be bothered re-typing it all out and taking another screenshot :D
 User generated image
You can also get to it from the View tab by clicking the 'Navigation Pane' tick box under 'Show'
User generated image
Search history can only be viewed when you click the down arrow in Advanced Find.
User generated image
In the Navigation Pane you can jump to advanced find .. or you can set the 'Advanced' options, including an additional 'Highlight All' that is specific to the Navigation Pane. You can also change these settings to be your default settings.
User generated image
As to the viability of using the search history to save the query? I would avoid it to be honest. Create a 'Useful Word Searches' document/note and store it with your Work items so you also have it backed up.
@John- good point on clicking MORE to access the additional options. :) Thanks.
@Daryl - Thanks for the additional info. Will check later this evening or tomorrow.
I wonder how far back the search history is saved. I see some items that may be from today only....I'll be curious to see what vanishes in the morning.

Also, I don't see the SET AS DEFAULT option in the Find Options....

Thanks.
Set as Default in the Navigation Pane pull down where we both showed you. Options is one of the first listed and Set as Default is there.

So far however, using the same document, after I have exited the document (normal for me) there is no history.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@John. Good call on the Notepad file.

Now, here's something weird. I was going through my doc and it found an instance on page 243. When I clicked FIND NEXT, it jumped to the title page. I clicked FIND NEXT again and it jumped to an instance on page 257. What's up with that? :)
I always start at the beginning of the document to search. I am not sure why it would skip by 243 on the second try unless it is recording what it found in this search.
Well, I had started at the beginning. But, since it's a long doc, I had left off around page 130 and resumed there this morning. So, it wasn't really a second try. Btw, the same thing happened again at a latter page...jump to beginning...and jump back to what I think was the next match.
I do not know for sure, but my guess is that the search is somehow caching results and not giving you what you already got, but I am not certain about that.
All,
I have not forgotten about this question. Have been immersed in both the day job and novel. Will close and assign points within the next few days. Thank you again!

Steve
@Daryl,

I just tried the search one more time, and - poof - it's not working. I must be missing something obvious b/c I didn't have my orange juice with breakfast... ;)
User generated image
Please check out this screenshot. I am also attaching the doc in question. Please forgive the corniness of the dialogue. :)

 

Thanks.
IngSearchNotWorkingToday.docx
It did not work for me in this document above. I will have to spend some time on it later today. The technique worked in a document of mine but not this one above.
I don't know.
Also it occurs to me that Office 2016 has been updated at least once since you started this.
@John
When you say the technique worked on "a document of mine", was that today or  a while ago? I assume the former. Thanks.
Yes, back in early November. I cannot see why this current document of yours does not work for you and does not work for me.
Does Microsoft publish release notes? Maybe they "changed" that feature to use a different wildcard or something.
You would have to Google for Office 2016 changes.
Hello Steve, it was patch Tuesday today and there was a substantial Windows 10 update followed by numerous Office 2016 updates. The wildcard approach we were using here is not working at all.

I don't know whether Daryl can shed any light.
So, how do we close this question? You guys have put in so much effort, so you deserve credit. But, I can't tag your comments as a solution lest other users find this question in a search.  Fortunately, I'm done with the editing phase that required this search, but, perhaps others may have the same question.

I'm going to suggest leaving this question open for a while to see if Microsoft fixes it.

Thanks.
There doesn't appear to be any text in that document you supplied that it should match on....

What word were you expecting it to highlight?

The pattern it is looking for is as specified right at the top..

The pattern here would be.
<Capital letter><one or more characters><"ing">

None of your 'ing' words in that section of text start with a capital letter. If you changed 'tearing' to 'Tearing' you will find it now matches.

Also,
<[A-Z][a-z]@ing>

Open in new window


only works on words that are 5 or more characters. For words of 4 characters (such as 'Ring') you would just remove the '[a-z]@' section as that becomes irrelevant.

<[A-Z]ing>

Open in new window


If you want to get lower case words (such as the 'ring' bits of your supplied text) then you need change the [A-Z] to [a-z] .. OR to match on upper or lower case as first letter you could change it to [A-Z,a-z], so

<[A-Z,a-z]@ing>

Open in new window


Ultimately you need to decide what it is you need to search for, as the search string was very specific to ensure it didn't get words that didn't match the original pattern.
OMG, my bad. Of course!  I forgot the premise of my original question.

As I said this morning:

>> I must be missing something obvious b/c I didn't have my orange juice with breakfast... ;)

Will close this question out within a day. Thanks Daryl and John and sorry to have wasted your time....
No worries :)  Easily done.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Daryl: Thank you for your elegant solution.
John: Thanks for the assists along the way, including the great suggestion to store the find parameters in a text file.

NOTE: I credited myself (no points) with an assisted solution to help anyone viewing this question to see one possible caveat.

This one was fun. EE rocks!
You are very welcome and I was happy to work with both you and Daryl.
@Paul - Thanks for your contribution at the top. Even though I ended up not using your solution, I appreciate the effort.