Well, I only know the Linux versions of "grep" and "sort," so you need to
check if yours are different. (Do you have man pages? If so, check the
options in them. If not, sort is supposed to have a "sort --help" switch.)
But, with that caveat ...
To sort the one sample file you provided, you would use a syntax
approximately like this:
sort -k 3 -nr -o jets.sorted JETS
(where
-k 3 means sort on the third field;
-nr means sort in reverse numeric order; and
-o means the next item is the name of the output file ).
This will leave the two header lines at one end or the other of the file,
but otherwise do what you want for the one file. For multiple files, the
syntax would be similar, something like this:
sort -k 3 -nr -o nfl.sorted JETS GIANTS BRONCOS ...
replacing ... with all the filenames or a suitable wildcard. Again, this
will leave all the header lines in, at one or the other end of the output file.
To get rid of the headers, you need to grep the files to extract only the
lines for players. Based on the example you provided, one method (there are
others) would be to grep for lines that contain numbers. This would look
something like:
grep -h [0123456789] jets giants ... | sort -k 3 -nr -o nfl.sorted -
In all cases, to change the stat you're sorting on, just change the -k entry
appropriately (and the output file name, of course).
Hope this helps. Good luck.
At 01:18 PM 12/29/98 PST, Don Harrison wrote:
[deleted]
>filename: JETS
[deleted]
> RUSHING STATS
> No Yds Avg Long Td
> Curtis Martin 369 1287 3.5 60t 8
> Leon Johnson 41 185 4.5 40 2
> Jerald Sowell 40 164 4.1 33 0
> Vinny Testaverde 24 104 4.3 25 1
> Keyshawn Johnson 2 60 30.0 35t 1
>
[deleted]
>In this case, the "Yds" category would be the determining sort order.
[deleted]
------------------------------------"Never tell me the odds!"---
Ray Olszewski -- Han Solo
762 Garland Drive
Palo Alto, CA 94303-3603
650.321.3561 voice 650.322.1209 fax [EMAIL PROTECTED]
----------------------------------------------------------------