<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
sub SQR{
    my $Num = shift(@_);
    return $Num*$Num;
}
sub MatchValue{
    my ($table,$Param1,$Param2) = @_;
    open( TABLE, "&lt; $table" ) or die "Can't open $table : $!";
    @tablines = &lt;TABLE&gt;;
    foreach $ciccia(@tablines)
    {
	chomp $ciccia;
	my @xVal = split / /,$ciccia;
	if($Param1 == $xVal[0] &amp;&amp; $Param2 == $xVal[1]){
	    return @xVal[2];
	}
    }
    close(TABLE);
}
sub ConvertTable{
    my ($filename,$table,$FileNameOut) = @_;
    open( FILE, "&lt; $filename" ) or die "Can't open $filename : $!";
    open( OUTFILE, "&gt; $FileNameOut" ) or die "Can't open $filename : $!";
    @lines = &lt;FILE&gt;;
    foreach $ciccia(@lines)
    {
	chomp $ciccia;
	my @xVal = split / /,$ciccia;
	my $Converted = 0.;
	$Converted = MatchValue($table,$xVal[0],$xVal[1]);
	printf OUTFILE "%lf %lf\n", @xVal[0]/4.32, $Converted;
    }
    close(FILE);
    print "Wrote on $FileNameOut\n";
}


$filename = @ARGV[0];
$table = @ARGV[1];
$outfile = @ARGV[2];
ConvertTable($filename,$table,$outfile);
</pre></body></html>