home *** CD-ROM | disk | FTP | other *** search
- sort.doc sort Version 1.38 by Rüdiger Werner
-
- The program and files in this distribution are freely distributable,
- but are also copyright (c) Rüdiger Werner. They may be freely
- distributed as long as no more than a nominal fee is charged to cover
- time and copying costs.
- No commercial usage is permitted without written permission from the
- author. Everything in this distribution must be kept together, in original
- unmodified form.
- This program is 'anyware', that means if you find this program useable or
- if you tried it then I'd like to receive anything from you.
- Of course I'd be very grateful, if you want to donate the author.
- The money will be used for a good purpose: I know very well a small indian
- boy who needs to be operated quite urgent. The parents have to pay the
- operation themselves, but they can't afford it. This is true, really.
-
- *************************
-
- I spent a lot of time on that program, now everything is ok so far.
- Of course the program is improved further. If you'd like to get a new
- version for a tiny fee, contact me. As far as I can tell already, it
- will be more as double as fast as this version. Some new features will
- be added too, as sorting by two criterions, e.g. sort by the 20th column
- and additionally sorting by the first.
- A graphical user interface is in work too, but that may take more time,
- because I have to do some other things too, like studying...
- It will be announced in the net, when it will be ready.
-
- *************************
-
-
- ***********************************************************************
- * Notice that the author can't be made responsible for the destroying *
- * or lost of data through use of this program. You use it on your own *
- * risc. Please read the Doc-file before using. *
- ***********************************************************************
-
- Please contact me if you have any comments or suggestions
- or if you simply tried the program:
-
- E-Mail: rw2@irz.inf.tu-dresden.de
- wernerr@iee1.et.tu-dresden.de
-
- URL: http://www.inf.tu-dresden.de/~rw2
- http://eeetw0.et.tu-dresden.de:8080/~wernerr
-
- Mail: Rüdiger Werner
- Stresemannplatz 2
- 01309 Dresden
- GERMANY
-
-
- CHANGES TO LAST VERSION
- the -s option now works also in a given range only
-
- Description
- -----------
-
- The program was written for use in Shell only.
- It is started either by simply typing it's name (of course it should be
- in the current directory or in the path) or by giving additionally switches
- and/or the name of the file what should be sorted.
-
- sort [switches] infile [infile 2 ... ] [outfile]
-
- By typing 'sort ?' appears a short help.
- The specified file is opened and red in the memory. There it will be sorted
- and, if the switches were set, manipulated in the required way.
-
- Switches:
-
- -a sorting the file in ascending order (it is optional, because default)
-
- -c[z] with this option the number of column can be specified, by which the
- file shall be sorted. This is useful to sort e.g. the RECENT files
- from Aminet by type.
-
- -d sorting the file in descending order
-
- -e all lines which are empty will be erased.
-
- -E after sorting all lines which are empty or more than once in a file
- will be erased (of course ONE of these lines is kept in the file).
-
- -f[y] using this option one can specify the first line of a range to be
- sorted. if this option is given, ALL actions are done ONLY within
- this range. to give also the last line is not compelling
- if y is bigger than the number of lines of the internal file
- (all in-read files together) an error-message appears and the
- program is cancelled
-
- -g actually the capitals and small letters are distinguished.
- by setting this switch, they won't be distinguished.
-
- -j[x] joins x files and sort them, after that the resulting file will be
- written to <outfile>
-
- -J[x] joins x files but they won't be sorted; the resulting file will be
- written to <outfile>
-
- -l[y] using this option one can specify the last line of a range to be
- sorted. if this option is given, ALL actions are done ONLY within
- this range. to give also the first line is not compelling
- if y is bigger than the number of lines of the internal file
- (all in-read files together) the last line is automatically taken
- as last line of the range
-
- if x or/and y is not given it will be asked for
-
- -n the file is not sorted, only empty lines are erased.
-
- -N the file is not sorted, only empty lines and lines with the same
- contents which are side by side are erased (of course ONE line is
- kept in the file).
- Note that it might more useful if the file is sorted.
-
- -o the specified file for reading will be overwritten by the sorted
- file. DANGER!!! If once overwritten the original file can't be
- restored!!!
-
- -p all lines, which doesn't match the search pattern will be removed
- the given string may be shorter than the lines, only the length of
- the string will be compared
-
- -P all lines, which match the search pattern will be removed
- see -p
-
- -r the file which was red will only be written in reverse order of lines
-
- -s[c] with this option the character c will be removed from the file.
- note: if characters like " need to be removed it is advisable to give this
- switch as the very last of the command line. Reason is that the following
- arguments are not recognized after a " by the programm.
-
- -x the sorting function will be disabled
-
-
- The switches can be set at any place after the program name.
- If the parameter to the switch is not given, it will be asked for.
- The program detects contradictions between given switches to avoid possible
- mistakes from the user
-
- Notice that the outfilename has to be the last of all filenames.
- If no outfilename is given, the first infilename plus a new ending is used
- for a suggestion for the outfilename.
-
- The maximum length of a line in a file is 1024 byte.
- All bytes that a line is longer than this are cutted. A message appears in
- this case. If you need to sort longer lines, just send me a mail.
-
- The size of the file to be sorted depends only on the size of the available
- memory (and on your patience). The used time is shown after sorting, just
- for your statistics ...
- I have tested the programm with hundreds of different files and no loss
- of data appeared.
- I'd be grateful for any comments, suggestions and bug reports.
- Well, that's all I can tell about it.
-
-
-
- Rüdiger Werner
-
-