So I have a text file and I need to sort the lines alphabetically. Example input:
This is the first sentence
A sentence here as well
But how do I reorder them?
Output:
A sentence here as well
But how do I reorder them?
This is the first sentence
Here's the thing: This file is so large, I don't have enough RAM to actually split it into a list/array. I tried to use Python's built-in sorted() function and the process got killed.
To give you an idea:
wc -l data
21788172 data