My sort program allows the user to input a file containing a list of words - or
pages of text or long reports. It produces an output file that contains all the
words of the input, sorted in either ascending or descending alphabetical order,
with frequency of use information if any word appears more than once.
Specifications:
- Input file
- The file containing words to be sorted, Berns_Sort input.txt, is located in c:\Program Files\Berns Sort
- Each variable length record may contain any number of words of any length
- Words consist of letters, which may be in upper and/or lower case; however, uppercase
letters are treated as lower case and are converted to lowercase on the output
- Apostrophes are completely ignored, which means that "don't" is treated as "dont"
- A sequence of one or more other non-letters (or end of record) delimit a word and
are discarded without comment (note that hyphens and numbers are merely word delimiters)
- Records and words within records may be in any order
- The program does not change the input file
- Output file
- The output file of variable length Ascii records, Berns_Sort output.txt, is placed
in c:\Program Files\Berns Sort and overwrites any same-named file that may already be there
- The first section of the output file contains summary information
- The second section contains one word per record in ascending or descending alphabetical
order
- If the input file contains any duplicate words, a third section is produced; it
contains the same list as the second section, except that each word is followed
by the number of times it appears on the input file