I have a simple way
keep a flag,when you get the name set the flag as one and if flag is one then get score.
foreach(traverse data) { if($data =~ /jack/) { //put some variable here for name $flag=1; } if($flag ==1 && $data=~ /Math Score2 - /) { $score=$'; $flag=0; } }
In reply to Re: Selecting successive lines
by ansh batra
in thread Selecting successive lines
by zee3b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |