Supon que mi_archivo.txt tiene lo siguiente:
 
Código:
 Periodo|Ajuste Cierre
1|388.39 
2|385.39 
3|376.84
7|392.46
23|416.11
     
Código Python:
Ver originalimport csv
 
my_list = []
with open('mi_archivo.txt', 'rb') as csvfile:
    reader = csv.reader(csvfile, delimiter='|')
    reader.next() # Ignore headers
    for row in reader:
        my_list.append((int(row[0]), float(row[1])))
 
my_list.sort()
for x, y in my_list:
    print x, y