#!/usr/local/bin/perl # combine.p file1 file2 # prints columns of each file alongside each other. # see also combine.p # $n = $#ARGV ; # number of arguments # print $n, "\n" ; # if($n < 1) { die ("usage - combine.p file1 file2"); } $a1 = 12 ; $b1 = 15 ; $a2 = 1 ; $b2 = 1 ; eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; open( F1, @ARGV[0] ) || die ("unable to open "); open( F2, @ARGV[1] ) || die ("unable to open "); $a1 -- ; $a2 -- ; $b1 -- ; $b2 -- ; $n ++ ; $t=0.0; while( ($l1 = ) && ( $l2 = ) ) { @f1 = split( ' ' , $l1 ) ; $x1 = join ( ' ' , @f1[$a1..$b1] ) ; @f2 = split( ' ' , $l2 ) ; $x2 = join ( ' ', @f2[$a2..$b2] ) ; printf("%s %s\n",$x1,$x2 ) ; }