considering the following table:
ID col1 col2 col3 col4
1 -16.06801249 13.49785832 -56.57087607 -27.00500526
2 -1.53315720 0.71731735 -42.03602078 -39.78554623
3 -1.53315190 0.71731587 -42.03601548 -39.78554771
4 -1.53316243 0.8731724 -42.53602760 -39.85545910
5 -16. 6533188 13.7606723 -42.03605186 -27.06753555
how to print (using sed or awk or ...): the smallest negative number from col4 that has value less than 1.0 in col2 (like 0.71731735, 0.8731724, etc but not 13.49785832 or 13.7606723)
expected result looks like:
ID col2 col4
2 0.71731735 -39.78554623
I appreciate for any idea
Birda