Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Using Regular expressions in Replace

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
excel_hari@yahoo.com - 23 May 2006 11:34 GMT
Hi,

Is it possible to use regular expressions to do a find/replace in Word
document.

I copied some data from an application in to word like this:-

asd
qwe
zxc
vbn
ghj
yui

I wanted to transpose it to a single row with a space (by doing a
replace on \n )
asd qwe zxc vbn ghj yui

(I could usually do such stuff with Textpad and want to know how to do
in Winword)

Regards,
HP
India
Doug Robbins - Word MVP - 23 May 2006 12:23 GMT
Using Edit>Replace, enter either ^p or ^l in the Find what control and put a
space in the Replace with control.

Whether you need the ^p or ^l will depend on whether each item is in a
separate paragraph, in which case the line will terminate with a ¶ when you
click on the Show/Hide button on the toolbar (the one with the ¶ icon).  For
that case, you would use ^p.  If each line does not terminate in a ¶, use ^l

Signature

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

> Hi,
>
[quoted text clipped - 20 lines]
> HP
> India
Hari - 23 May 2006 12:49 GMT
Doug,

Thanks a lot for this. This will certainly help me a lot.

regards,
HP
India
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.