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 / August 2005

Tip: Looking for answers? Try searching our database.

Find/Replace issue with wildcard

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Will - 24 Aug 2005 20:22 GMT
Hello My Friends,
 Does anyone know an easy way to do the following:

I have a list of data:
.ts1p0{position:absolute;left:264px;top:56px;}
.ts1p1{position:absolute;left:1px;top:52px;}
.ts1p2{position:absolute;left:64px;top:52px;}
.ts1p3{position:absolute;left:214px;top:36px;}
...

and I want to replace
<div class="ts1p0">
<div class="ts1p1">
<div class="ts1p2">
<div class="ts1p3">
...

with
<div style="position:absolute;left:264px;top:56px;">
<div style="position:absolute;left:1px;top:52px;">
<div style="position:absolute;left:64px;top:52px;">
<div style="position:absolute;left:214px;top:36px;">
...

Thanks a lot!!

-- Will
Doug Robbins - 24 Aug 2005 21:03 GMT
Don't see where the "<div class=" features in your list of data, but with

(.ts1p[0-9]{1,}\{)(position:absolute;left:[0-9]{1,}px;top:[0-9]{1,}px;\})

in the Find what control of the Edit Replace dialog and with

<divstyle="\2">

In the replace with control,

.ts1p0{position:absolute;left:264px;top:56px;}
.ts1p1{position:absolute;left:1px;top:52px;}
.ts1p2{position:absolute;left:64px;top:52px;}
.ts1p3{position:absolute;left:214px;top:36px;}

will be replaced by

<divstyle="position:absolute;left:264px;top:56px;}">

<divstyle="position:absolute;left:1px;top:52px;}">

<divstyle="position:absolute;left:64px;top:52px;}">

<divstyle="position:absolute;left:214px;top:36px;}">

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

> Hello My Friends,
>  Does anyone know an easy way to do the following:
[quoted text clipped - 23 lines]
>
> -- Will
Jezebel - 24 Aug 2005 22:21 GMT
For pIndex = 1 to however_many_items_in_your-datalist

   pSource = Choose(pIndex,
".ts1p0{position:absolute;left:264px;top:56px;}", _
                                             ".ts1p1{position:absolute;left:1px;top:52px;}",
_
                                             ".ts1p2{position:absolute;left:64px;top:52px;}",
_
                                               :
                                   )

   pSearch = "class=" & chr$(34) & mid$(pSource, 2, 5) & chr$(34)
   pReplace = "style=" & chr$(34) & mid$(pSource, 8, len(psource)-9) &
chr$(34)

   Find and Replace: pSearch, pReplace        [Assume you know how to do
this bit]

Next

> Hello My Friends,
>  Does anyone know an easy way to do the following:
[quoted text clipped - 23 lines]
>
> -- Will

Rate this thread:






 
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.