-5
我對編程非常新穎。我需要在perl中逐行讀取一個文件。該文本文件有兩列和100,000行都有數字。我需要對每個數字應用此公式(/ 16)* 100,並且結果應該是一個單獨的文件,並且包含2列和100000行。一個算術計算每個數字在一個txt文件中由perl
use strict;
use warnings;
my $filename = 'results_AH.txt';
open(my $fh, '<:encoding(UTF-8)', $filename)
or die "Could not open file '$filename' $!";
while (my $row = <$fh>) {
chomp $row;
print "$row\n";
}
print "done\n";
這就是我所擁有的。該文件看起來像(只是一個部分)。請幫忙:)
AH LHH
5 0
4 0
3 0
5 0
5 0
4 0
3 0
4 0
4 0
4 0
5 0
5 0
3 0
4 0
你卡在哪裏? – Jens