Re: 3/1/01 - Need simple (hopefully) code
- How about (off the top of my head):
s/<#FIELD NAME = (.*?)>(.*?)<\/#FIELD>/s/<#FIELD NAME = $1>$2<\/#FIELD
(should all be on one line). You may have to escape the '#' character,
I don't know the regexp special chars off.
Charles can probably suggest a better, shorter one.
--- In perl-beginner@y..., "Gorden-Ozgul, Patricia E" <gorden@b...>
> If you have helped me recently, thank you. Each reply has helped mein some
> way.get it).
> In any case, I need a quick/short solution. (like tonight if I can
> I have data..
> <#FIELD NAME = AAA>this is its value</#FIELD>
> <#FIELD NAME = BBB>this is its value</#FIELD>
> I want to go through the entire file and replace the end tag with
> specific tag name embedded somewhere in it.to the
> For example, this is what I need:
> <#FIELD NAME = AAA>this is its value</#FIELD AAA>
> <#FIELD NAME = BBB>this is its value</#FIELD BBB>
> Something like storing the string from after the equal sign (=) up
> right caret (>) of the beginning tag to a variable andright
> inserting the contents of that variable immediately preceeding the
> caret (>) of the end tag.
> ...For each record.
> If anyone has a clue, please pass it along.
> Thank you.
> Pat Gorden-Ozgul BNL-ISD Systems
> gorden@b... 631-344-5159