How can I use ^#^#^#^#(space)^$ FIND and REPLACE with ^#^#^#^t^$ ?

M

Maurice

I am trying to reformat many huge documents and need to replace the "space"
that follows a four figure number with a tab mark without changing the four
figure number, or any subsequent space (none of which follow four figure
numbers until the next paragraph).

I cannot use the ^# symbol for "any digit" in the replace function.

How can I only change the one space for a tab in each paragraph? It is the
3rd space every time in pages of text like : "10 Nov 1788 JAMES Hemingway, of
Southo......"
 
J

Jay Freedman

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

In the Find What box, enter the expression

([0-9]{4})

and type a space character after the closing parenthesis.

In the Replace With box, enter the expression

\1^t

Click the Replace All button.

The search expression says "find any sequence of four characters in the
group from 0 through 9, followed by a space". The parentheses indicate that
the four digits form a group. The replacement expression says "replace the
found expression by the found group in parentheses, followed by a tab
character".

For more information on wildcard searches, see
http://www.gmayor.com/replace_using_wildcards.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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