I know similar questions have been asked but they don't address the finer details and not in PHP...
I have a .txt file with a comma separated list of numbers.It's simple enough to sort the file, split it and save into multiple smaller files. What would be an memory efficient way to put small chunks of these files back together and sort them?
All my current attempts to do this have resulted in huge memory utilisation.
A more specific way to put it could be:
- how do I stream small pieces of data from a file
- track which pieces of data I've already processed
- Create a buffer, and when the buffer is full write it out
- start back at 1 and repeat until all the data has been sorted