use warnings;
use strict;
open(INFILE, "/Users/lizeshuo/Desktop/test2.txt") || die "Cannot open the newfile: $!\n";
open(OUTFILE, ">test3.txt") || die "Cannot open the newfile: $!\n";
my @a;
while (<INFILE>) {
chomp;
@a = split;
print OUTFILE "$a[1]"." ";
print OUTFILE "$a[2]"." ";
}
exit;
open(INFILE, "/Users/lizeshuo/Desktop/test3.txt") || die "Cannot open the newfile: $!\n";
my @b;
my $number = 1;
my $c;
my @d
while (<INFILE>) {
chomp;
@b = split;
$c = $b[$number + 1] - $b[$number];
push @d, $c;
$number = $number + 2;
}
exit;
use strict;
open(INFILE, "/Users/lizeshuo/Desktop/test2.txt") || die "Cannot open the newfile: $!\n";
open(OUTFILE, ">test3.txt") || die "Cannot open the newfile: $!\n";
my @a;
while (<INFILE>) {
chomp;
@a = split;
print OUTFILE "$a[1]"." ";
print OUTFILE "$a[2]"." ";
}
exit;
open(INFILE, "/Users/lizeshuo/Desktop/test3.txt") || die "Cannot open the newfile: $!\n";
my @b;
my $number = 1;
my $c;
my @d
while (<INFILE>) {
chomp;
@b = split;
$c = $b[$number + 1] - $b[$number];
push @d, $c;
$number = $number + 2;
}
exit;