#!/usr/bin/perl

open(OLD, "machine_ALL_REAL.dat");
open(NEW, ">mac.dat");

@bo=<OLD>;

@out1 = sort {
    (split(/\s+/, $a))[0] <=> (split(/\s+/, $b))[0]
  } @bo;

$num1=@bo;
$n=0;
while($n<$num1){
    @data1=split(/\s+/,$out1[$n]);
    print "$data1[0] $data1[1] $data1[2] \n";
    if($data1[0]>-5.5 && $data1[0]<8){
	if($data1[1]>-10 && $data1[1]<5){
	    if($data1[2]>0 && $data1[2]<18){
		print NEW ("$data1[0] $data1[1] $data1[2] \n");
	    }}}$n++;}
