I need to sort a text file in ascending order. Each line of the text file starts with an index, as seen below:
2 0 4 0d 07:00:38.0400009155273
3 0 4 0d 07:00:38.0400009155273
1 0 4 0d 07:00:38.0400009155273
The idea result would be as follows:
1 0 4 0d 07:00:38.0400009155273
2 0 4 0d 07:00:38.0400009155273
3 0 4 0d 07:00:38.0400009155273
Please note, this text file has +3 million rows and each element is naturally considered a string.
I've been messing around with this for sometime now without any luck so I figured it was time to consult with the experts. Thank you for you time!
EDIT:
I'm using windows OS with Python 3.7 in Spyder IDE. The file is not a CSV its a text file that is tab delimited. There is the possibility that not all indices are present. Forgive the noob-ness, I haven't got a lot of experience coding.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…