#!/usr/bin/perl # cleanup of data files $version="1.2"; $date="21 Nov 2008"; # by Nick Manini sub print_help { print STDERR <0 or die "there is no point setting a threshold <=0\n"; next; } if($p eq "-h"){ # print help print_help; exit; } print STDERR "Error: invalid option $p\n "; print_help; exit; } if ($#FILELIST==-1) { push(@FILELIST,"-"); # adds stdio for lack of arguments } while ($filename=shift(@FILELIST)){ # loop on filenames open(INF, $filename); # Open for input while (){ # loop on lines in the file s/^\s+//; @data=split(/[()\s]+/); $x=$data[0]+0; $y=$data[1]+0; # print $x," ",$y,"\n"; if(abs($data[0]-$xkeep)/(abs($xkeep)+$TINY) > $thresh && abs($data[1]-$ykeep)/(abs($ykeep)+$TINY) > $thresh){ print; $xkeep=$x; $ykeep=$y; } } close(INF); }