tomatocans
asked on
Loop for awk
In the following awk script
BEGIN{
FS="|"
}
{
if($1=="NAME"){
VOLUME_NAME=$2
}
if($1=="LOCATION"){
LOCATION_LAT[i]=$2
LOCATION_LNG[i]=$3
LAT_DEG[i]=substr($2,1,2)
LAT_MIN[i]=substr($2,3,2)
LAT_SEC[i]=substr($2,5,2)
LNG_DEG[i]=substr($3,1,3)
LNG_MIN[i]=substr($3,4,2)
LNG_SEC[i]=substr($3,6,2)
LAT[i]=LAT_DEG[i] + LAT_MIN[i] / 60. + LAT_SEC[i] / 3600.
LNG[i]=LNG_DEG[i] + LNG_MIN[i] / 60. + LNG_SEC[i] / 3600.
?????????????
}
if($1="DATA"){
ALT_LOW=$2
ALT_HIGH=$3
}
for(i=1;i<=???????????;i++
(VOLUME_NAME"|"LOCATION_LA
}
}
What is needed to make this for loop print correctly. I think I have to assign a number based on
LOCATION_LAT[i] but I can't seem to get it right.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. The perfect solution.
YOu won't need a loop.