home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!bonnie.concordia.ca!hobbit.ireq.hydro.qc.ca!beaurega
- From: beaurega@ireq.hydro.qc.ca (Denis Beauregard)
- Newsgroups: comp.os.msdos.programmer
- Subject: Re: Sorting/Printing
- Message-ID: <BtD55v.6uA@ireq.hydro.qc.ca>
- Date: 22 Aug 92 02:20:19 GMT
- References: <1992Aug20.022202.2349@menudo.uh.edu>
- Sender: news@ireq.hydro.qc.ca (Netnews Admin)
- Organization: Institut de recherche d'Hydro-Quebec, Varennes, Canada
- Lines: 28
-
- In article <1992Aug20.022202.2349@menudo.uh.edu> libh@Jane.UH.EDU writes:
- >
- > I am working on a project for a friend that requires me to sort a large file
- >of records (2000+ entries generally) that will change from month to month as he
- >gets updates so I can never be certain of the number of records. I would
- >appreciate any suggestions on sorting the file. Right now I am debating on how
- >to treat it as a large array on disk and sort it as if it were in memory, but I
- >also realize that it would be VERY slow. Any suggestions would be greatly
- >appreciated.
- >
-
- You forget to indicate what language you are using.
-
- In C language, there is a function for sorting. With large model,
- your could build a table of 8000 entries, read your file line by line
- and using strdup() have pointers in the table, then using a sort function
- (most if not all C or C++ compilers have a sorting routine built-in).
- I did so and made some customization. For example, I can recode a
- line so that J.4.12.3 > J.4.4.2, or names are de-abbreviated during sort.
-
- If you have Basic, you will be probably very limited.
-
-
- --
- \_\ Denis Beauregard * internet:beaurega@ireq.hydro.qc.ca
- / \ Genealogiste officiel : Beauregard/Jarret/Jarest/Vincent
- J __> Vient de paraitre : Andre Jarret et ses Ancetres
- \_.-=== En vente par l'auteur Opinions ? Et pis non !
-