# skip the header line, assuming it's the first line # otherwise, you'll have to check in the loop to see # if you have grabbed a number or a string my $header = ; my $total = 0; my $count = 0; while() { $total += (split('"', $_))[3]; $count++; } print "Average: ",$total/$count, "\n";