All pastes #631164 Raw Edit

Anonymous

public text v1 · immutable
#631164 ·published 2007-07-23 19:31 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.');

my @givenlines = <$givenh>;
my @totallines = <$totalh>;

foreach my $givenl (@givenlines){
    chomp $givenl;
    print $givenl;
    print ' ';
    foreach my $totall (@totallines){
        chomp $totall;
        if ($totall =~ /$givenl/) {
            my @array = split(/ /, $totall);
            print $array[0];
            print ' ';
        }
    }
    print "\n";
}