#! /usr/bin/perl

my $testgood = `modules/check_dir.pl | tail -1`;
if ( $testgood != 1 ) {
    printf("Strange directory.\n");
    printf("Please run this script only in Stand1 or Stand2 directory.\n");
    exit;
}

$NARGS = $#ARGV +1;
if ( $NARGS < 2 || $NARGS > 2 ) {
    printf("Need (only) two arguments: input and putput file names!\n");
}

$file_in=$ARGV[0];
$file_out=$ARGV[1];

open(INFILE, $file_in);      # Open the file
@lines = <INFILE>;           # Read it into an array
close(INFILE);               # Close the file
#print @lines;                # Print the array

open(OUTFILE, ">$file_out"); # Open for output

foreach $data (@lines)
{
    chop $data;
    if ($data ne '0x00000000')
    {
	#print $data "\n";
	print OUTFILE $data;
	print OUTFILE "\n";
    }
}

close(OUTFILE);               # Close the file
