How do I get lines with a range of numbers?

advertisements

I have a text file like this:

    1.1    2.4   10.1
    5.6   10.5    2.9
   10.8   29.2   -2.1
   12.7   29.1   -2.1
   15.2   38.5   -5.2
   25.0   41.1  -19.1

Now, I would like to obtain the lines which its 1st-column has number less than 15 using awk, sed, or any other commands. Anybody knows? It must produce:

  1.1    2.4   10.1
  5.6   10.5    2.9
 10.8   29.2   -2.1
 12.7   29.1   -2.1


awk '$1<15' input_file

Test:

[jaypal:~/Temp] cat f
1.1    2.4   10.1
5.6   10.5    2.9
10.8   29.2   -2.1
12.7   29.1   -2.1
15.2   38.5   -5.2
25.0   41.1  -19.1
[jaypal:~/Temp] awk '$1<15' f
1.1    2.4   10.1
5.6   10.5    2.9
10.8   29.2   -2.1
12.7   29.1   -2.1