#! /usr/local/bin/f8	ss
\ # post-process output from pstotext, ps2ascii; convert sequential to screen-file, &c
\ # xec: text-lines < infile > outfile
also linux decimal

80 =: chars/line	\ # adjust to suit

\ # ------------------------------------------------------------------------------------ #

00 =: out-sz
1 +to char/line
 
here chars/line 8 + allot =: buf

: -t-
    begin
	buf dup chars/line 2dup 4+ erase out-sz - 2dup bounds 0 to out-sz
	do in-chan read-char 
	    if dup i c! #10 = -leave else drop in-chan ch-eof -leave endif 
	loop
	>r zcount dup r> 1- > 
	if 2dup bl rscan dup to out-sz if #10 swap c! else drop endif endif
	out-chan write-file -dup if bye-r endif drop
	in-chan ch-eof
    until
bye ;

-t-
