A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Need some Search & Replace help



 
 
Thread Tools Display Modes
  #1  
Old January 22nd, 2007, 03:10 PM posted to microsoft.public.word.newusers
scotteh
external usenet poster
 
Posts: 6
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  
Old January 22nd, 2007, 03:51 PM posted to microsoft.public.word.newusers
Jay Freedman
external usenet poster
 
Posts: 9,488
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



  #3  
Old January 22nd, 2007, 03:51 PM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
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



  #4  
Old January 22nd, 2007, 04:10 PM posted to microsoft.public.word.newusers
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
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





  #5  
Old January 22nd, 2007, 04:50 PM posted to microsoft.public.word.newusers
Terry Farrell
external usenet poster
 
Posts: 3,004
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






  #6  
Old January 22nd, 2007, 04:58 PM posted to microsoft.public.word.newusers
scotteh
external usenet poster
 
Posts: 6
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.


  #7  
Old January 22nd, 2007, 05:06 PM posted to microsoft.public.word.newusers
scotteh
external usenet poster
 
Posts: 6
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".


  #8  
Old January 22nd, 2007, 06:19 PM posted to microsoft.public.word.newusers
Jay Freedman
external usenet poster
 
Posts: 9,488
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



  #9  
Old January 22nd, 2007, 06:52 PM posted to microsoft.public.word.newusers
Terry Farrell
external usenet poster
 
Posts: 3,004
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




  #10  
Old January 23rd, 2007, 07:25 AM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Need some Search & Replace help

Because of the time Outlook Express takes to update the current group, I had
no way of knowing he had posted - however the rest bit is probably true - I
had been moving a lime tree to a new location and was knackered

--

Graham Mayor - Word MVP

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


Terry Farrell wrote:
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.