Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find and Replace with Wildcards 4

Status
Not open for further replies.

chasethewind

Technical User
Oct 29, 2004
63
US
OK, this should be EZ for someone out there.

Here is the problem:

N 45-56-47 E need to look like N 45°56'47" E

how do I use wildcards to pull this off?
 
a: what application ?
b: why do you need to use wildcards ?
c: how do you think this is possible in Find/Replace given that - needs to be repaced with ° and also ' ?

If you have a standard format i.e.

N nn-nn-nn E

then you just need to do some string manipulation along the lines of

=Left(A1,4) & "°" & Mid(A1,6,2) & "'" & right(A1,4)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Guessing a little - and assuming it's Word - this should work:
Find: [blue][tt] ([ENSW] [0-9]{2})-([0-9]{2})-([0-9]{2})( [ENSW])[/tt][/blue]
Replace:[blue][tt] \1°\2'\3"\4[/tt][/blue]
(check "Use Wildcards")


Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Tony - A star for you, I never knew you could do that with find and replace, thanks.


Stubnski
 
Thanks for the stars.

Word Find & Replace uses a limited sort of regular expression. Sometimes (when you're really lucky) it does just what you want; sometimes it throws up its hands in horror with a message like "too complex". Also there is a bug (fixed in 2007) where the replacement shown here will be in the wrong order if Track Changes is active.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top