home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / fish / 881-890 / ff885 / false / other / readable.f < prev    next >
Text File  |  1993-07-16  |  575b  |  35 lines

  1. {readable.f}
  2. {gets a textfile and makes it readable (cuts off after Xth pos at space) }
  3. ^0b:0c:
  4. [d:'0 d;>~'91+d;>&]
  5. [1_c:b;10*b:d;'0-b;+b:^]
  6. #"amount: "b;."
  7. "c;
  8. [0a:
  9.  [d;$1_=~]
  10.  [$10=$
  11.   [0a:10,       { a:=0 ; println }
  12.   ]?
  13.   ~[
  14.      $' =a;b;>&$        {is it a ' ' textchar and a>b?}
  15.      ["
  16. "    0a:
  17.      ]?
  18.      ~[d;,
  19.      ]?
  20.   ]?
  21.   {print char}
  22.   { increment counter. Beware of TAB's! }
  23.   '    =[a;7+a:]?
  24.   a;1+a:
  25.  ^d:]#
  26. ]?
  27. ~
  28. [
  29. "readable: required argument missing.
  30. Usage: readable number <filename_in [>filename_out]
  31.        number tells where to split up the lines.
  32. "
  33. ]?
  34.  
  35.