Link to home
Start Free TrialLog in
Avatar of MichelleLacy
MichelleLacy

asked on

conditional replace using Perl

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"/>
SOLUTION
Avatar of Adam314
Adam314

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MichelleLacy
MichelleLacy

ASKER

I am very new to perl, so would you walk me through this a little.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you.  I used it right away, but forgot to close the session.