I would like to sort (by number) a file of data that looks like below:
ABGH SDFDS 123
SDFS sDF 12
Can somebody help me?
You can split and create new list with the numbers as the first part of the rec and then use the builtin sort method, or convert to a list of lists as below. Whichever is easier in this case.[CODE]data_as_lists = [ line.strip().split() for line in data ] ## convert to … Read More