Skip to content

Instantly share code, notes, and snippets.

@slawo-ch
Created December 5, 2017 19:56
Show Gist options
  • Select an option

  • Save slawo-ch/db926db898e91a7618478e7a99d7afd6 to your computer and use it in GitHub Desktop.

Select an option

Save slawo-ch/db926db898e91a7618478e7a99d7afd6 to your computer and use it in GitHub Desktop.
while (($key, $value) = each(%transformFiles)) {
open my $dataFile, $key or die "Can't open '$key': $!";
open my $transformFile, '>', $value or die "Can't open '$value': $!";
my $line=<$dataFile>;
chomp($line);
$line =~ s/\r*//g;
print $transformFile $line, "\t", "Adjusted M1", "\n";
while (my $line=<$dataFile>)
{
$adjustM1 = substr($line, 27, 3) * 2;
chomp($line);
$line =~ s/\r*//g;
print $transformFile $line, "\t", $adjustM1, "\n";
}
close $dataFile;
close $transformFile;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment