All pastes #631175 Raw Edit

Anonymous

public text v1 · immutable
#631175 ·published 2007-07-23 19:38 UTC
rendered paste body
# Code to create gmt files

use strict;
use warnings;

my ($given, $total) = @ARGV;

open (my $givenh, $given) or die('Given.');
open (my $totalh, $total) or die('Total.');

while (my $givenl = <$givenh>){
    chomp $givenl;
    print $givenl;
    print ' ';
    my @garray = split(/ /,$givenl);
    while (my $totall = <$totalh>){
        chomp $totall;
        if ($totall =~ /$garray[0]/) {
            my @array = split(/ /, $totall);
            print $array[0];
            print ' ';
        }
    }
    print "\n";
}