Board index » delphi » Sort a file .. !!

Sort a file .. !!

 Does anyone happen to have a good idea how to sort a file ... lets say i
have a file of numbers 12 23 2 3 9 54 67 11 32 69 and I want to sort it
but with out using an array to put all the numbers in it and then
recreate the file ... because if there were other things in the file
there would be a problem !!

 

Re:Sort a file .. !!


Quote
Mavrikis Manolis <corrup...@hol.gr> wrote:
> Does anyone happen to have a good idea how to sort a file ... lets say i
>have a file of numbers 12 23 2 3 9 54 67 11 32 69 and I want to sort it
>but with out using an array to put all the numbers in it and then

You could create a linked list, and sort pointers?  By your
definition, you aren't very clear with what it is you want to do, from
my perspective.  Linked lists are alot of fun once you learn about
sorting large arrays, especially in protected mode.

Re:Sort a file .. !!


Quote
Mavrikis Manolis <corrup...@hol.gr> wrote:
> Does anyone happen to have a good idea how to sort a file ... lets say i
>have a file of numbers 12 23 2 3 9 54 67 11 32 69 and I want to sort it
>but with out using an array to put all the numbers in it and then
>recreate the file ... because if there were other things in the file
>there would be a problem !!

Niklaus Wirth's book "Algorithms + Data Structures = Programs" has a
section (2.3) on sorting sequential files, with Pascal code.

Other Threads