Re: output formatting

2023-09-11 Thread Dr . Jürgen Sauermann
Hi Stephen, On 9/10/23 21:58, Stephen Lewis via Bugs and suggestions for GNU APL wrote: ... When using 'apl' script in a pipeline I was surprised to find formatting clearly designed for a terminal when output was going to a file. Especially when the formatting has the effect of changing the

Re: output formatting

2023-09-10 Thread Stephen Lewis via Bugs and suggestions for GNU APL
Thank you all for the quick replies and suggestions. Chris Moller, Bill Daly - Thanks, "Page Width" (Print Width?) solved my immediate problem, --PW 500 on commandline or ⎕pw←500. 'tr' and 'sed' does fix the spaces and blank line but my version (Gnu APL 1.8 from tarball) does not have --exec

Re: output formatting

2023-09-10 Thread Dr . Jürgen Sauermann
Hi, the problem seems to be that you let APL print to a terminal (which wraps long lines at ⎕PW). A better way is probably to use one of the ⎕FIO functions in your APL script as to write directly to the output file (which bypasses the terminal). Of course output forwarding in the shell would

Re: output formatting

2023-09-10 Thread Kacper Gutowski
On Sun, 10 Sept 2023 at 01:08, Stephen Lewis wrote: > Writes elements in 4 row matrix with spurious > extra characters and a blank line. One thing you could do is to increase the print width ⎕PW so that it doesn't wrap, but ultimately this default printout is intended for human consumption.

Re: output formatting

2023-09-09 Thread Bill Daly
If you change your printing width APL may not print the overflow of each line as a separate line.   tmp←2 50 ⍴ ⍳ 100   ⎕pw←225   tmp  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 

Re: output formatting

2023-09-09 Thread Chris Moller
Try adding the option "--PW 1000" (or any large number less than 1).  That will set the print width to huge. The tr utility with the -s option can compress repeated spaces into a single space. sed '$d' will kill the last line. So something like apl --PW 500 --eval "2 70⍴⍳140" | tr