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 / blnk2tab.icn < prev    next >
Text File  |  2000-07-29  |  836b  |  33 lines

  1. ############################################################################
  2. #
  3. #    File:     blnk2tab.icn
  4. #
  5. #    Subject:  Program to convert strings of 2 or more blanks to tabs
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     August 13, 1995
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program converts strings of two or more blanks to tabs.  It
  18. #  reads from standard input and writes to standard output.
  19. #
  20. ############################################################################
  21.  
  22. procedure main(args)
  23.    local line
  24.  
  25.    while line := read() do
  26.       line ? {
  27.          while writes(tab(find("  ")), "\t") do
  28.             tab(many(' '))
  29.          write(tab(0))
  30.          }
  31.  
  32. end
  33.