Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
scotteh scotteh is offline
external usenet poster
 
Posts: 3
Default Need some Search & Replace help

HI all. I need to do an unusual search and replace and need some help.
Hopefully this is fairly basic for most people.

I have strings of numbers, cd-track-index all grouped together and I
want to seperate them with tabs. So the list looks like this:

231001
241002
253401
271501

They need to end up like this:

23 10 01
24 10 02
25 34 01
27 15 01

except with tabs instead of spaces. So I need to search for any 2
digits, then replace them with the SAME 2 digits + a tab character.

Any ideas?

Thanks!!

Scott

  #2   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Need some Search & Replace help

A wildcard search for

([0-9]{2})([0-9]{2})([0-9]{2})
replace with
\1^t\2^t\3
should do the trick

See http://www.gmayor.com/replace_using_wildcards.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


scotteh wrote:
HI all. I need to do an unusual search and replace and need some help.
Hopefully this is fairly basic for most people.

I have strings of numbers, cd-track-index all grouped together and I
want to seperate them with tabs. So the list looks like this:

231001
241002
253401
271501

They need to end up like this:

23 10 01
24 10 02
25 34 01
27 15 01

except with tabs instead of spaces. So I need to search for any 2
digits, then replace them with the SAME 2 digits + a tab character.

Any ideas?

Thanks!!

Scott



  #3   Report Post  
Posted to microsoft.public.word.newusers
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Need some Search & Replace help

Dead heat!

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Graham Mayor" wrote in message
...
A wildcard search for

([0-9]{2})([0-9]{2})([0-9]{2})
replace with
\1^t\2^t\3
should do the trick

See http://www.gmayor.com/replace_using_wildcards.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


scotteh wrote:
HI all. I need to do an unusual search and replace and need some help.
Hopefully this is fairly basic for most people.

I have strings of numbers, cd-track-index all grouped together and I
want to seperate them with tabs. So the list looks like this:

231001
241002
253401
271501

They need to end up like this:

23 10 01
24 10 02
25 34 01
27 15 01

except with tabs instead of spaces. So I need to search for any 2
digits, then replace them with the SAME 2 digits + a tab character.

Any ideas?

Thanks!!

Scott





  #4   Report Post  
Posted to microsoft.public.word.newusers
Terry Farrell Terry Farrell is offline
external usenet poster
 
Posts: 2,904
Default Need some Search & Replace help

Doug

Strictly speaking, Jay hit the send button 48 seconds before Graham. vbg

Terry

"Doug Robbins - Word MVP" wrote in message
...
Dead heat!

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Graham Mayor" wrote in message
...
A wildcard search for

([0-9]{2})([0-9]{2})([0-9]{2})
replace with
\1^t\2^t\3
should do the trick

See http://www.gmayor.com/replace_using_wildcards.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


scotteh wrote:
HI all. I need to do an unusual search and replace and need some help.
Hopefully this is fairly basic for most people.

I have strings of numbers, cd-track-index all grouped together and I
want to seperate them with tabs. So the list looks like this:

231001
241002
253401
271501

They need to end up like this:

23 10 01
24 10 02
25 34 01
27 15 01

except with tabs instead of spaces. So I need to search for any 2
digits, then replace them with the SAME 2 digits + a tab character.

Any ideas?

Thanks!!

Scott






  #5   Report Post  
Posted to microsoft.public.word.newusers
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Need some Search & Replace help

It was morning in the US and late afternoon in Cyprus. I was just a little
better rested. g

Jay

Terry Farrell wrote:
Doug

Strictly speaking, Jay hit the send button 48 seconds before Graham.
vbg
Terry

"Doug Robbins - Word MVP" wrote in message
...
Dead heat!

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Graham Mayor" wrote in message
...
A wildcard search for

([0-9]{2})([0-9]{2})([0-9]{2})
replace with
\1^t\2^t\3
should do the trick

See http://www.gmayor.com/replace_using_wildcards.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


scotteh wrote:
HI all. I need to do an unusual search and replace and need some
help. Hopefully this is fairly basic for most people.

I have strings of numbers, cd-track-index all grouped together and
I want to seperate them with tabs. So the list looks like this:

231001
241002
253401
271501

They need to end up like this:

23 10 01
24 10 02
25 34 01
27 15 01

except with tabs instead of spaces. So I need to search for any 2
digits, then replace them with the SAME 2 digits + a tab character.

Any ideas?

Thanks!!

Scott





  #6   Report Post  
Posted to microsoft.public.word.newusers
Terry Farrell Terry Farrell is offline
external usenet poster
 
Posts: 2,904
Default Need some Search & Replace help

That probably explains it then.

Terry

"Jay Freedman" wrote in message
...
It was morning in the US and late afternoon in Cyprus. I was just a little
better rested. g

Jay

Terry Farrell wrote:
Doug

Strictly speaking, Jay hit the send button 48 seconds before Graham.
vbg
Terry

"Doug Robbins - Word MVP" wrote in message
...
Dead heat!

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Graham Mayor" wrote in message
...
A wildcard search for

([0-9]{2})([0-9]{2})([0-9]{2})
replace with
\1^t\2^t\3
should do the trick

See http://www.gmayor.com/replace_using_wildcards.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


scotteh wrote:
HI all. I need to do an unusual search and replace and need some
help. Hopefully this is fairly basic for most people.

I have strings of numbers, cd-track-index all grouped together and
I want to seperate them with tabs. So the list looks like this:

231001
241002
253401
271501

They need to end up like this:

23 10 01
24 10 02
25 34 01
27 15 01

except with tabs instead of spaces. So I need to search for any 2
digits, then replace them with the SAME 2 digits + a tab character.

Any ideas?

Thanks!!

Scott




  #7   Report Post  
Posted to microsoft.public.word.newusers
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Need some Search & Replace help

In the Replace dialog, first click the More button and check the box for
"Use wildcards".

Copy the next line and paste it in the Find What box:

([0-9]{2})([0-9]{2})([0-9]{2})

Copy/paste the next line in the Replace With box:

\1^t\2^t\3

Click the Replace All button, and you're done.

Explanation: First, read http://www.gmayor.com/replace_using_wildcards.htm.
Then you'll be able to see that the Find What expression means "look for
text that consists of three consecutive groups of two digits each", and the
Replace With expression means "replace with the same three groups separated
by tab characters".

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

scotteh wrote:
HI all. I need to do an unusual search and replace and need some help.
Hopefully this is fairly basic for most people.

I have strings of numbers, cd-track-index all grouped together and I
want to seperate them with tabs. So the list looks like this:

231001
241002
253401
271501

They need to end up like this:

23 10 01
24 10 02
25 34 01
27 15 01

except with tabs instead of spaces. So I need to search for any 2
digits, then replace them with the SAME 2 digits + a tab character.

Any ideas?

Thanks!!

Scott



  #8   Report Post  
Posted to microsoft.public.word.newusers
scotteh scotteh is offline
external usenet poster
 
Posts: 3
Default Need some Search & Replace help

Thanks guys! However... didnt work. I understand what that SHOULD do,
so I pasted it in (didnt even type it, PASTED! so I wouldnt make any
mistakes, tried both even though they seem identical) and hit Find Next
and it said "the search item was not found".

Nothing in the document was highlighted. It just cant find a match! I
even tried just ([0-9]{2}) to see if it would find the first 2 and no
go. Then I put spaces between the first sets. Nothing. Then I added
just the number 23 on a blank line and put the cursor on a line before
it. Still found nothing!

This is Word 2000 SR1 btw.

These are the exact first few lines:

MIX 219902
MIX 222202
MIX 219803
MIX 219802
MIX 219903
MIX 212302
MIX 241103
MIX 255301

I've already put a tab between MIX and the numbers.

Any other ideas?

Scott



Jay Freedman wrote:
In the Replace dialog, first click the More button and check the box for
"Use wildcards".

Copy the next line and paste it in the Find What box:
([0-9]{2})([0-9]{2})([0-9]{2})
Copy/paste the next line in the Replace With box:
\1^t\2^t\3
Click the Replace All button, and you're done.


  #9   Report Post  
Posted to microsoft.public.word.newusers
scotteh scotteh is offline
external usenet poster
 
Posts: 3
Default Need some Search & Replace help


Ahhh crap! Nevermind. I found it. I clicked More and found that "Use
Wildcards" was turned off.

All fixed!

Thanks again guys!! Excellent work!!

Scott



scotteh wrote:
Thanks guys! However... didnt work. I understand what that SHOULD do,
so I pasted it in (didnt even type it, PASTED! so I wouldnt make any
mistakes, tried both even though they seem identical) and hit Find Next
and it said "the search item was not found".


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
search and replace with a numbered reference a_nokes Microsoft Word Help 8 May 5th 06 03:41 AM
Pasting into a search and replace Ben K. Bullock New Users 6 March 6th 06 05:50 AM
Search and Replace not working if I select a Format for Heading St Sherrie Deen Microsoft Word Help 0 April 27th 05 08:53 PM
search and replace symbol characters Patricia G. Kurz Microsoft Word Help 1 December 29th 04 03:11 AM
search and replace symbols pattyjo Microsoft Word Help 2 December 29th 04 03:10 AM


All times are GMT +1. The time now is 04:55 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"