home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
historic
/
v941.tgz
/
icon.v941src.tar
/
icon.v941src
/
ipl
/
progs
/
tabulate.icn
< prev
next >
Wrap
Text File
|
2000-07-29
|
922b
|
40 lines
############################################################################
#
# File: tabulate.icn
#
# Subject: Program to tabulate lines in a file
#
# Author: Ralph E. Griswold
#
# Date: February 28, 1999
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# This program produces a tabulation showing how many times each
# line of a file occurs.
#
############################################################################
#
# Links: options
#
############################################################################
link options
procedure main(args)
local opts, tabulation
tabulation := table(0)
while tabulation[read()] +:= 1
tabulation := sort(tabulation, 3)
while write(get(tabulation), " ", right(get(tabulation), 6))
end