home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8708 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  1.8 KB

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