I want to sort a really very huge file of approx 80GB, the file contains Lastnames on each line (separated by \r\n
)
Because I am on shared resources with 1GB RAM available, is there a way to do this without putting all the data into a array in PHP?
I earlier came up with the idea to pick up chunks of 1GB, sort each chunk as separate sorted file, than I ended up with 80 sorted 1GB files on the file system. But I was quickly failed with this approach when I realized that I yet need to sort these 80 files with each other, for example reading two 1GB files will make 2048Megs which exceeds the size of my RAM so how would this work?
Considering the resources available to me, is this a possible task? Is there any other way?