| Well, I finally did it with PERL, here is the code:
open (INFILE, "XXXX");
open (OUTFILE, "> YYYY");
while (<INFILE>)
{
($v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9) = split;
$xf = $v1 + $v6;
$yf = $v2 + $v7;
if ( $v5 == 1 ) {
print OUTFILE $v1, "\t", $v2, "\t", $xf, "\t", $yf, "\n";
}
}
close INFILE;
close OUTFILE;
Apart from the "split" function, there is other thing that my poor brain has noticed: the ">" symbol is seems to have more meanings other than to point the direction of the process, or what?
There is no hope with awk in my computer (a P4, 2.4 GHz, 1Gb RAM with SuSE9.1 personal). It can read and print values in decimal form. It can even calculate with decimals in the console, but not through the program. Here is the code:
{
if ($5 == 1)
{ OFS = "\t" ; ORS = "\n" ; print $1, $2, $1 + $6, $2 + $7 ; }
}
It still produces things without decimal values like this:
64 414 100 432
64 439 71 406
64 464 67 465
64 489 66 491
64 539 70 563
64 564 72 595
64 589 30 619
64 639 51 675
So, the question is: does the function "BEGIN" has something to do here? I do not really understand very well its meaning and much less how to use it. Well I think that would be a matter for another topic. I could finally make this PERL code to work and that was thanks to your help guys!!! Thanks to Cabhan, Steve and Santa's little helper!!!
Hernan |