Reply
 
Thread Tools Display Modes
  #1   Report Post  
Greg Maxey
 
Posts: n/a
Default Find the last item

I should know this but I am drawing a blank.



Using FindReplaceUse Wildcards



Find: b*^13

Replace with: ^& with format bold



Why is the last line missed? (Note -It isn't if I ensure there is an empty
paragraph following the last line)



It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times


Thanks.
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


  #2   Report Post  
Herb Tyson [MVP]
 
Posts: n/a
Default

Ummm... it wasn't missed here--all lines were changed (and I made sure there
was only 1 paragraph mark at the end). I wonder if your last paragraph mark
is defective. I assuming you're using Word 2003. I wonder if we have the
same compatibility settings (although I can't think of anything there,
offhand, that would affect the results). Mine is set up as vanilla Word
2003.

--
Herb Tyson MS MVP
Please respond in the newsgroups so everyone can follow along.
http://www.herbtyson.com
"Greg Maxey" wrote in message
...
I should know this but I am drawing a blank.



Using FindReplaceUse Wildcards



Find: b*^13

Replace with: ^& with format bold



Why is the last line missed? (Note -It isn't if I ensure there is an
empty paragraph following the last line)



It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times


Thanks.
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.



  #3   Report Post  
Greg Maxey
 
Posts: n/a
Default

Herb,

Something odd going on here. My compatibility was Word2003 vanilla with two
toppings.

Add space for underlines
Draw underlines on trailing spaces

I cleared both and replacement worked as expected.

I then closed Word. Went in and reapplied the two compatibility options and
replace still works as expected.

One of those perplexing things about Word.

Thanks for the nudge.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Herb Tyson [MVP] wrote:
Ummm... it wasn't missed here--all lines were changed (and I made
sure there was only 1 paragraph mark at the end). I wonder if your
last paragraph mark is defective. I assuming you're using Word 2003.
I wonder if we have the same compatibility settings (although I can't
think of anything there, offhand, that would affect the results).
Mine is set up as vanilla Word 2003.

I should know this but I am drawing a blank.



Using FindReplaceUse Wildcards



Find: b*^13

Replace with: ^& with format bold



Why is the last line missed? (Note -It isn't if I ensure there is an
empty paragraph following the last line)



It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times


Thanks.
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.



  #6   Report Post  
Russs
 
Posts: n/a
Default

On 9/18/05 12:33 AM, in article
, "Russs"
wrote:

On 9/18/05 12:10 AM, in article
, "Russs"
wrote:

On 9/17/05 11:27 PM, in article , "Greg
Maxey" wrote:

I should know this but I am drawing a blank.



Using FindReplaceUse Wildcards



Find: b*^13

Replace with: ^& with format bold



Why is the last line missed? (Note -It isn't if I ensure there is an empty
paragraph following the last line)



It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times


Thanks.


Greg, I was able to simulate what you said, if I run the replace with the
cursor at the end of the file. If I move the cursor to the beginning of the
file, the replace does find all the lines including the last one. Is that a
bug in Word? I'm using Word 2004 on the Mac.

I was able to narrow it down to the fact that if the cursor is before the
'b' in the last sentence, it will find the whole phrase in the last
sentence. Therefore it must only check from the cursor position to the end
of the current sentence that the cursor is in even if you want to check the
whole document.

Sorry to appear to ramble on, but I'm sending off messages as I think of
something new.
So it seems that Word marks the last sentence segment as already checked and
doesn't see it again when it comes around full circle.
Yes, it is like a bug.
One way they could fix it is always start a 'global' document search from
the beginning of the file.
--
Russs

drsmN0SPAMikleAThotmailD0Tcom.INVALID -- fix this before replying

  #7   Report Post  
Daiya Mitchell
 
Posts: n/a
Default

On 9/17/05 9:10 PM, "Russs" wrote:

I'm using Word 2004 on the Mac.


Sidenote: Hi Russs--did you know there are also Mac-specific MS newsgroups?
You may find them useful someday.

See here for Google/Entourage gateway to newsgroups for MacWord, MacExcel,
and other MS programs for the Mac:
http://www.microsoft.com/mac/community/community.aspx?pid=newsgroups

--
Daiya Mitchell, MVP Mac/Word
Word FAQ: http://www.word.mvps.org/
MacWord Tips: http://www.word.mvps.org/MacWordNew/
What's an MVP? A volunteer! Read the FAQ: http://mvp.support.microsoft.com/

  #8   Report Post  
Russs
 
Posts: n/a
Default

On 9/18/05 11:44 AM, in article ,
"Daiya Mitchell" wrote:

On 9/17/05 9:10 PM, "Russs" wrote:

I'm using Word 2004 on the Mac.


Sidenote: Hi Russs--did you know there are also Mac-specific MS newsgroups?
You may find them useful someday.

See here for Google/Entourage gateway to newsgroups for MacWord, MacExcel,
and other MS programs for the Mac:
http://www.microsoft.com/mac/community/community.aspx?pid=newsgroups

Thanks Daiya, for the link. I wasn't aware of that webpage. I knew about
Mactopia but didn't get involved with newsgroups until recently. I found the
newsgroups through Entourage. You must be on the West Coast because of our
difference in timestamps on our respective messages.

Yes, I have browsed most of the Microsoft Word newsgroups, including the Mac
newsgroup, for the last couple of months ever since I wanted to learn how to
use Word to data mine files at work, which use WinWord. So I've been
learning the ins and outs of Find and Replace and how to use them in macros.
I'm familiar with all kinds of programming and the use of regular
expressions or wildcards as Word calls them. I wish Microsoft would make the
wildcards as powerful as some of the better forms of regular expressions.

I'm comfortable on the Mac and Windows, but I love the Mac more, in big part
because I can be more productive with less time rooting out virii and other
malware or reinstalling the OS. I started off as a big fan of the Commodore
Amiga.

I did comment on another bug specific to the Mac, in the Mac newsgroup
thread, '^13 code for finding paragraph marks is broken!' As a kludge fix, I
can enclose ^13 like [\^13] to get it to work with wildcards on the Mac. Of
course, using \n, which is also specific to Mac, I believe, is easier, but
doesn't carry over to the Windows side in macros.

drsmN0SPAMikleAThotmailD0Tcom.INVALID -- fix this before replying

  #9   Report Post  
Klaus Linke
 
Posts: n/a
Default

Hi Russs,

You'll often run into problems when the cursor is in the middle of the
expression you are searching for.
More often than not, Word will miss the match since it searches downwards to
the end of the document, and then back from the start.


Find: a*b
does seem to match if a and b are in the same word, but not in other cases.

Probably the algorithm must decide how much of the text should be checked
twice, and has to draw a line somewhere.

It's safer to go to the beginning of the document (or story range) before
you start a wildcard search.

Regards,
Klaus



"Russs" schrieb im Newsbeitrag
VALID...
On 9/18/05 12:33 AM, in article
, "Russs"
wrote:

On 9/18/05 12:10 AM, in article
, "Russs"
wrote:

On 9/17/05 11:27 PM, in article ,
"Greg
Maxey" wrote:

I should know this but I am drawing a blank.



Using FindReplaceUse Wildcards



Find: b*^13

Replace with: ^& with format bold



Why is the last line missed? (Note -It isn't if I ensure there is an
empty
paragraph following the last line)



It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times

It was the best of times it was the worst of times


Thanks.

Greg, I was able to simulate what you said, if I run the replace with
the
cursor at the end of the file. If I move the cursor to the beginning of
the
file, the replace does find all the lines including the last one. Is
that a
bug in Word? I'm using Word 2004 on the Mac.

I was able to narrow it down to the fact that if the cursor is before the
'b' in the last sentence, it will find the whole phrase in the last
sentence. Therefore it must only check from the cursor position to the
end
of the current sentence that the cursor is in even if you want to check
the
whole document.

Sorry to appear to ramble on, but I'm sending off messages as I think of
something new.
So it seems that Word marks the last sentence segment as already checked
and
doesn't see it again when it comes around full circle.
Yes, it is like a bug.
One way they could fix it is always start a 'global' document search from
the beginning of the file.
--
Russs

drsmN0SPAMikleAThotmailD0Tcom.INVALID -- fix this before replying



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't find records using the the find record command in a merged Johnny Tidwell Mailmerge 1 June 23rd 05 11:37 AM
Find and Replace GREEK symbols in XP, 2K & 97 Jazz Microsoft Word Help 3 April 8th 05 08:13 PM
how to find one word at a time in a large document? whartonmatt Microsoft Word Help 1 April 7th 05 05:36 PM
Find & Replace does not find formatting Ed Microsoft Word Help 5 April 1st 05 12:33 AM
Find and Replace anomaly BruceM Microsoft Word Help 7 January 18th 05 05:47 PM


All times are GMT +1. The time now is 02:31 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"