I have a text file which contains
Name subj1 subj2 subj3 Evans 24 45 55 charles 25 24 26
output: Charles average is:sumofmarks/3use strict; use warnings; my $line = "test_scores.txt"; open(FH, $line) or die "Cannot open $line"; readline(FH); #<-- read the first line effectively skipping it while($line=<FH>){ if ($line=~m/^C/) { print($line); } }
In reply to Retrieve average by Tigor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |