Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/src/cmd/4th/examples/line2txt.4th

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


\ Copyright 2004 - J.L. Bezemer
\ Converts multiline textfiles, delimited by a blank line,
\ to 4tH readable textfiles

variable written

: Usage abort" Usage: line2txt infile outfile" ;
: Read-file refill ;
: Preprocess 0 written ! ;

: reset Preprocess drop drop cr ;
: ?space dup if space then ;
: write /tib written @ ?space - min 0 max dup written +! type ;

: Process
  0 parse -trailing dup 0=
  if reset
  else write
  then
;

[needs lib/convert.4th]


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.