I have a representative dataset
35.5259 327
35.526 326
35.526 325
35.5261 324
35.5262 323
35.5263 322
35.5264 321
35.5265 320
35.5266 319
35.5268 318
# Contour 4, label:
35.5269 317
35.527 316
35.5272 315
35.5274 314
35.5276 313
35.5278 312
35.528 311
# Contour 4, label:
35.5282 310
35.5285 309
35.5287 308
35.529 307
35.5293 306
I try to find the two max values within a range in col 2 with:
awk '320>$2,$2>315 && $1>max1{max1=$1;line=$2} 313>$2,$2>307 && $1>max2{max2=$1;line2=$2} END {printf " %s\t %s\t %s\t %s\n",max1,line,max2,line2}' FILENAME
I just get blank ouput (As I have lots of blank spaces in the txt file)How to ignore that ? with $1+0 == $1 ?
I would like to find the Max values in col1 between 320 and 315 and between 313-307 in col2. The output I need:
35.5266 319 35.5278 312
How do I get the desired output ? Thanks