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 / digcol.icn < prev    next >
Text File  |  2000-07-29  |  920b  |  37 lines

  1. ############################################################################
  2. #
  3. #    File:     digcol.icn
  4. #
  5. #    Subject:  Program to produce nth column of digit data
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     November 25, 1996
  10. #
  11. ############################################################################
  12. #
  13. #  This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program filters input to produce the nth column of digit date.
  18. #
  19. ############################################################################
  20.  
  21. procedure main(args)
  22.    local n, line, s
  23.  
  24.    n := (0 < integer(args[1])) | stop("*** invalid specification")
  25.  
  26.    while line := read() do
  27.       line ? {
  28.          every 1 to n do {
  29.             tab(upto(&digits)) | stop("*** column ", n, " does not exist")
  30.             s := tab(many(&digits))
  31.             }
  32.       
  33.          write(s)
  34.          }
  35.  
  36. end
  37.