Помимо комментария / ответа @Mark Meyer, это мой подход в Python.
with open('sample.txt','r') as f:
c = f.readlines()
c = [ x.strip('\n').split() for x in c[2:] if x.strip('\n') !='']
# Assign elements to a list [['1', '2', '3'], ['2', '10', '3'] ...
min_number = 10 # ciriteria
c = [c[index] for index, value in enumerate(c) if int(value[1]) > min_number ]
# Keep elements that respect the criteria [['5', '12', '1'] ...
# If you want to keep 10 too, modify list comprehension to >=
# Write output to same file
with open('sample.txt','w') as f:
for iter, each_line in enumerate(c): # resetting the row number to 1,2, ..
f.write('{}\t{}\t{}\n'.format( iter+1,each_line[1],each_line[2] ) )