From jwm1003@mrao.cam.ac.uk Wed Mar 22 17:31:07 2000 From: James Miskin To: mackay@mull.ra.phy.cam.ac.uk #!/usr/local/bin/perl # modify.p f=1 t=3 cut=1 $cut = 1 ; $f=1; $t=2; $w=7; $th=-1.0; $show=0; $left=0; $smallest=0; $abs=0; $endnewline = 0 ; # How to override min and max values with command line eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; $f--; $t--; if ($t<$f) { $t = $f ; } $num = $t - $f + 1 ; $white = " " x ($w) ; while (<>) { if ($_ ne "\n") { @fields = split("\t",$_); $I = $#fields ; print STDERR "has $I fields\n" ; if ($cut) { for ( $i = 0 ; $i <= $I ; $i++) { if ($i == $f ) { $i = $t + 1 ; } print substr($fields[$i].$white,0,$w) ; print " "; } } else { for ( $i = $f ; $i <= $t ; $i++) { print substr($fields[$i].$white,0,$w) ; print " "; } } } print "\n" ; } if ( $endnewline ) { print "\n" ; }