have time for some education?
perl -pe 'if (/^foo(\\d+)=(.*\\n)/) {$r ||= $2; $_="foo4=$r" if 4==$1;}' testdata notice I am using ttffp tags
now I want to be sure I clearly understand what is going on. I throw my file at this string
perl -pPrint -eEdit single tick to resolve the following enclosed actions
if (what is the / before the first foo? ^foo followed by a decimal place holder and has a .* followed by a newline and the closing /?
$r is replace || (why the 2 pipes? $2 being the second field $_"foo4=$r(eplaced value) if 4 is exactly equal to $1 the first field. ending tick
corrections and information gladly accepted,
thanx,
bill
All tribal myths are true, for a given value of "true" Terry Pratchett
[link|http://boxleys.blogspot.com/|http://boxleys.blogspot.com/]
Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free american and do not reflect the opinions of any person or company that I have had professional relations with in the past 48 years. meep
questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]