#!/usr/local/bin/perl # combine.p file1 file2 # prints first column of each file alongside each other. # see also combine2.p # $n = $#ARGV ; # number of arguments # print $n, "\n" ; # if($n < 1) { die ("usage - combine.p file1 file2"); } open( F1, @ARGV[0] ) || die ("unable to open "); open( F2, @ARGV[1] ) || die ("unable to open "); # $n ++ ; $t=0.0; while( ($l1 = ) && ( $l2 = ) ) { @f1 = split(' ',$l1); ($x1, $rest)= @f1; @f2 = split(' ',$l2); ($x2, $rest)= @f2; printf("%s %s\n",$x1,$x2 ) ; }