We help IT Professionals succeed at work.

conditional replace using Perl

MichelleLacy
MichelleLacy asked
on
486 Views
Last Modified: 2012-05-06
I have a body of text and I want to do a conditional replace based, I am assuming with an if statement.

text example:  So I want to replace part of line 3, the attribute name, which is  "Significance", with a concatenation of line 1 value, in this case, "AtPID LR score" + "Significance".  How do I do this?

line1 <attr name= "mref" value = "AtPID LR score" index = "0" />
line 2<attr name= "Method" value = "AtPID LR score"  index = "0" />
line 3 <attr name= "Significance" value = "1248.12"  index = "0"/>
Comment
Watch Question

Top Expert 2009
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
I am very new to perl, so would you walk me through this a little.
Top Expert 2009
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
thank you.  I used it right away, but forgot to close the session.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.