You could do it with this kind of grep statement ...

    (id="1".+)\/col>$
    \1/company>

... as the pattern -- just in case there is some other closing tag in  
your file that has "col" in it, such as "collate", "college",  
"collision", "color", etc. This grep statement assumes that the tag "/ 
col" occurs at the end of lines.

On Dec 19, 2008, at 8:31 AM, Chris wrote:

>
> Hi All
>
> I am trying to use grep for a find and replace on an xml document.
> What I am trying to do is select  id="1"
> then select the closing element "/col" to change to "/company".
>
>
>       <row id="2">
>               <col id="1">Sonitrol Corp.</col>
>               <col id="2">Joseph Tranfaglia</col>
>               <col id="3">1 Merrill St.</col>
>               <col id="4">Woburn</col>
>               <col id="5">MA</col>
>               <col id="6">01801</col>
>               <col id="7">www.sonitrol.com</col>
>               <col id="8">508-649-2019</col>
>               <col id="9">[email protected]</col>
>               <col id="10">Electronice Security, Monitoring, Fire 
> Inspections</
> col>
>               <col id="11">New England</col>
>       </row>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "[email protected]" 
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---

Reply via email to