I have a large file (1m records, 300mb) that I want to sort based on multiple field values. Any one got any handy vba code that will do this for me?
I’ve been googling for an answer and I think that I have an approach
Step 1 – create ‘n’ temporary sorted files
1) read t records into array (memory)
2) sort records
3) write temp file
4) repeat until all input records have been read
Step 2 – merge temporary files
1) read top record from every file
2) sort file pointers based on sort key
3) write to output file from file with lowest key
4) read another record from file in 3)
5) go to 2 until no more records
Any one got any code they want to donate? Or suggestions on improvements?
Its a little be more difficult than that