All pastes #631196 Raw Edit

Anonymous

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

use strict;
use warnings;

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

open (my $givenls, $given) or die('Given.');
open (my $totalls, $total) or die('Total.');

while (my $givenl = <$givenls>){
    chomp $givenl;
    print $givenl;
    print ' ';
    while (my $totall = <$totalls>){
        chomp $totall;
        if ($totall =~ /$givenl/) {
            my @first = split /,\s*/, $totall;
            print $first[0];
            print ' ';
        }
    }
    print "\n";
}