I would like to sort a file in Python based on numerical values:
My input file looks like this:
66135 - A 65117 - B 63301 - C 63793 - D
f2.writelines(sorted(f1, key=lambda line:int(line.split()[0])))
where f2 is your output file and f1 is your input file.