views:

18

answers:

1

i am using gawk on a windows computer with cygwin what i am trying to do is find min and max from three columns two are lat and lon and the third column is the value this is the code:

echo off
for /f "tokens=1,2,3 delims= " %%a in
('gawk "BEGIN {maxc = 0} {maxlo=0} {maxla=0}
{if ($3>maxc) maxc=$3} {if ($1>maxlo) maxlo=$1} {if ($2>maxla) maxla=$2} END
{print maxc, maxlo, maxla}" %file%.projected')
do ( set maxc=%%a
set maxlo=%%b
set maxla=%%c
) echo max is %maxc% echo max is %maxla% echo max is %maxlo% for /f "tokens=1,2,3 delims= " %%a in
('gawk "BEGIN {minc =1000} {minlo=1000} {minla=1000}
{if ($3 {print minc, minlo, minla}" %file%.projected')
do ( set minc=%%a
set minlo=%%b
set minla=%%c
)
echo min %minc%
echo min %minla%
echo min %minlo%

what i get is:

max is 465.053890
max latitude is 31.846428
max is 34.877658
min 19.976970
min 31.846428
min 34.877658

the min and max are the same for the lon and lat how can i compare real numbers?