awk to search for pattern and remove line

I am an awk beginner and need help figuring out how to search for a number in the first column and if it (or anything greater) exists, remove those lines.

AM11400012012   2.26   2.12   1.98   2.52   3.53   3.01   3.62   5.00   3.65   7.95   0.79   3.88   0.00
AM11400012013   3.39   2.29   3.28   3.14   3.17   7.77   5.04   4.54   1.46   4.94   2.75   0.00  -9.99
AM11400012014  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99
AM11400012015  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99  -9.99
AU11500010001   2.73   2.12   2.37   2.12   4.66   4.93   4.77   4.07   1.38   2.27   2.67   2.40   0.00
AU11500010002   2.66   3.19   2.12   2.11   1.50   3.18   2.81   2.14   3.62   3.83   2.25   1.53   0.00

I want to remove the lines that contain AM11400012014 and AM11400012015. That first column is fixed, so those 4 digits will always be in that position.

Thanks!

Try:

awk 'substr($1,length($1)-3) <= 2013' file
1 Like