![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Hobby Coder
Join Date: May 2006
Posts: 57
Rep Power: 0
![]() |
Quote:
Primary sortkey, secondary sortkey, tertiary sortkey, etc.? And what is your operating system, pray tell? I'm assuming it's Windows since the file you uploaded appears to be a Windows text file. Just to be sure though. *YOU* could be in like a porch climber! I've certainly written, and been quite proud of the result of, a large sorting program that used Quicksort arrays over and over, and finally mergesort, to handle the amount of data that could never be sorted in memory. But I've also learned that sometimes a very much smaller, (and much easier to maintain) bat file, could do the same thing, in far less time. I don't want to talk you out of your programming effort - I believe it's a noble one and you'll undoubtedly already have learned a lot from working on it. This is just an alternative, and much simpler way, imo. Adak |
|
|
|
|
|
|
#12 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 852
Rep Power: 4
![]() |
One way to sort the whole lot in your program is to read all the data into one big array, then sort the whole lot.
Do you still need the binary output files? If not, just read each input file and add the data into a big array (you could use realloc to allocate memory). Then just call qsort once after all the files have been processed. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|