Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Databases > Re: Simple disk...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 37 Topic 361 of 386
Post > Topic >>

Re: Simple disk-based sorting method

by "Ed Prochak" <edprochak@[EMAIL PROTECTED] > Apr 13, 2007 at 07:43 AM

On Apr 13, 8:40 am, s...@[EMAIL PROTECTED]
 (Citizen Bob) wrote:
> I have a disk file which contains 370,260 records of average length 60
> ASCII text characters. I need to sort them on the first 9 characters,
> which are set off from the rest by a space.
>
> Once sorted the first record looks like
> 100100100 08:35-08:39 4 0 0 1 -115 -1 75 -100 dd17.txt
> and the last one looks like
> 500900900 12:41-13:25 44 1 885 0 0 1 925 -200 dd21.txt
>
> There is not enough memory in my Win2K/SP4 system to implement the
> traditional memory-based sorting algorithms, so I need to use a method
> that is disk-file based. I have plenty of disk space.
>
> I imagine that this method would open the input disk file and begin
> reading records one at a time and performing some kind of sort
> algorithm placing the result in a tem****ary output file. Once the
> original file has been swept, the process starts over and runs again
> and again for the required number of iterations until the entire list
> is sorted in ascending order. I will implement this method in standard
> DOS-based C (Microsoft Optimizing C Compiler "cl") using the Win2K
> DVM.
>
> Suggestions and references please.
>
> --
>
> "Nothing in the world can take the place of perseverance. Talent
> will not; nothing is more common than unsuccessful men with talent.
> Genius will not; unrewarded genius is almost a proverb. Education
> will not; the world is full of educated derelicts. Persistence and
> determination alone are omnipotent."
> --Calvin Coolidge


I think a variation of Radix sort would work nicely. Any algorithms
textbook should discuss it. And the definitive reference is Knuth's
volume Sorting and Searching. This would be the comp.programming
answer, given your description of programming in C.  (newsgroups are
arranged by topic for a reason.)

OTOH, you posted this in comp.databases so I'll now assume you want a
DB oriented answer. And that answer would be to pick a DBMS that runs
on your platform (WIN2K is pretty old), load the data into a table
with primary key (pkx) being those first 9 characters, then just let
the DBMS do the sorting when you issue a command like

SELECT * FROM tablex ORDER BY pkx ;

HTH,
ed
 




 37 Posts in Topic:
Simple disk-based sorting method
spam@[EMAIL PROTECTED] (  2007-04-13 12:40:27 
Re: Simple disk-based sorting method
"Ed Prochak" &l  2007-04-13 07:43:19 
Re: Simple disk-based sorting method
spam@[EMAIL PROTECTED] (  2007-04-13 15:34:31 
Re: Simple disk-based sorting method
Gene Wirchenko <genew@  2007-04-13 21:52:54 
Re: Simple disk-based sorting method
spam@[EMAIL PROTECTED] (  2007-04-14 16:47:00 
Re: Simple disk-based sorting method
Bob Stearns <rstearns1  2007-04-14 17:04:37 
Re: Simple disk-based sorting method
spam@[EMAIL PROTECTED] (  2007-04-15 06:31:54 
Re: Simple disk-based sorting method
"--CELKO--" <  2007-04-14 06:02:00 
Re: Simple disk-based sorting method
Gene Wirchenko <genew@  2007-04-17 10:58:15 
Re: Simple disk-based sorting method
Last Boy Scout <BadBil  2007-04-14 15:44:01 
Re: Simple disk-based sorting method
mAsterdam <mAsterdam@[  2007-04-15 02:11:03 
Re: Simple disk-based sorting method
spam@[EMAIL PROTECTED] (  2007-04-15 06:41:53 
Re: Simple disk-based sorting method
spam@[EMAIL PROTECTED] (  2007-04-15 06:47:37 
Re: Simple disk-based sorting method
David Kelly <n4hhe@[EM  2007-04-14 22:08:10 
Re: Simple disk-based sorting method
spam@[EMAIL PROTECTED] (  2007-04-15 06:47:38 
Re: Simple disk-based sorting method
David Kelly <n4hhe@[EM  2007-04-15 16:44:29 
Re: Simple disk-based sorting method
Last Boy Scout <BadBil  2007-04-15 21:03:37 
Re: Simple disk-based sorting method
Last Boy Scout <BadBil  2007-04-15 21:06:21 
Re: Simple disk-based sorting method
spam@[EMAIL PROTECTED] (  2007-04-16 11:53:31 
Re: Simple disk-based sorting method
David Kelly <n4hhe@[EM  2007-04-16 22:47:08 
Re: Simple disk-based sorting method
spam@[EMAIL PROTECTED] (  2007-04-17 13:09:39 
Re: Simple disk-based sorting method
Lemming <thiswillbounc  2007-04-28 00:44:49 
Re: Simple disk-based sorting method
Brian Inglis <Brian.In  2007-05-27 17:07:02 
Re: Simple disk-based sorting method
"Ed Prochak" &l  2007-04-16 10:37:23 
Re: Simple disk-based sorting method
"Ed Prochak" &l  2007-04-16 10:48:04 
Re: Simple disk-based sorting method
spam@[EMAIL PROTECTED] (  2007-04-16 18:48:01 
Re: Simple disk-based sorting method
--CELKO-- <jcelko212@[  2007-04-18 08:06:06 
Re: Simple disk-based sorting method
toby <toby@[EMAIL PROT  2007-04-20 20:31:10 
Re: Simple disk-based sorting method
Lemming <thiswillbounc  2007-04-28 01:25:34 
Re: Simple disk-based sorting method
toby <toby@[EMAIL PROT  2007-04-20 20:31:46 
Re: Simple disk-based sorting method
toby <toby@[EMAIL PROT  2007-04-20 20:34:48 
Re: Simple disk-based sorting method
"Paul Linehan"   2007-07-05 16:24:54 
Re: Simple disk-based sorting method
Lennart <erik.lennart.  2007-07-05 19:29:15 
Re: Simple disk-based sorting method
"Paul Linehan"   2007-07-06 10:10:11 
Re: Simple disk-based sorting method
David Segall <david@[E  2007-07-06 05:26:22 
Re: Simple disk-based sorting method
"Paul Linehan"   2007-07-06 10:05:24 
Re: Simple disk-based sorting method
David Segall <david@[E  2007-07-06 18:21:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 4:02:33 CDT 2008.