Find and Replace digits

E

EK

Hi all,

I am using Word 2003 and I ran into a find and replace problem where I need
a little help. I have a large document that have text and numbers such as
1.25, 100.34, etc. I want to replace single spaces one before and one after
each number with a comma w/o changing the numbers. Any idea-EK Esawi
 
M

macropod

Hi EK,

You asked essentially the same question in this NG yesterday. For some reason both your question and my reply seem to have
disappeared:

Find = ( )([0-9.]{1,})( )
Replace = ,\2,
Check the 'use wildcards' option.
Do note that this will also act on numbers followed by a period then a space (eg 12. ). If you don't like that, you could use two
Find/Replace
operations:
Find1 = ( )([0-9]{1,})( )
Find2 = ( )([0-9]{1,}.[0-9]{1,})( )
The first Find picks up integers only, whilst the second picks up decimals only.

If you want to keep the spaces before/after the newly inserted commas, use:
Replace = \1,\2,\3
 
M

macropod

Hi EK,

I've now found your previous post - you attached it to a thread from 23-24 September this year. Did you bother reading my reply to
that post?

--
macropod
[Microsoft MVP - Word]


macropod said:
Hi EK,

You asked essentially the same question in this NG yesterday. For some reason both your question and my reply seem to have
disappeared:

Find = ( )([0-9.]{1,})( )
Replace = ,\2,
Check the 'use wildcards' option.
Do note that this will also act on numbers followed by a period then a space (eg 12. ). If you don't like that, you could use two
Find/Replace
operations:
Find1 = ( )([0-9]{1,})( )
Find2 = ( )([0-9]{1,}.[0-9]{1,})( )
The first Find picks up integers only, whilst the second picks up decimals only.

If you want to keep the spaces before/after the newly inserted commas, use:
Replace = \1,\2,\3


--
Cheers
macropod
[Microsoft MVP - Word]


EK said:
Hi all,

I am using Word 2003 and I ran into a find and replace problem where I need
a little help. I have a large document that have text and numbers such as
1.25, 100.34, etc. I want to replace single spaces one before and one after
each number with a comma w/o changing the numbers. Any idea-EK Esawi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top