([: }. (' 0';'  ') stringreplace ' '&,)"1@:":          i. 3 4

An optional left argument x is the format argument to ":

This verb converts an arbitrary rank array to a string vector which `looks' the same as the original.  I use it to dump arrays onto files.  There may be library support for this but I am not well versed in the contents of the _z_ or other standard locales.

   convert_array_to_string
(0 >. <:@:rank@:]) (-@:[ }. ([: ,/"2 ,&LF"1)@:]^:[) ":

   rank
#@:$


Now I'll read your subsequent posts.

On 09/28/2017 08:00 AM, [email protected] wrote:
Date: Wed, 27 Sep 2017 17:57:54 +0200
From: Rudolf Sykora<[email protected]>
To:[email protected]
Subject: [Jprogramming] print an array
Message-ID:
        <caoedro1eakqxb279f2j4vb-8yx7oxfkeqncc20anfv7gv-e...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Hello,

I have an array of integers

  0  0  0  0  0  0  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  0  0  0  0  0

and I want to have it printed (to a string, say) without
the zeros. I.e, I want to replace each isolated 0 with a space.
How can I do it?

Thanks
Ruda

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to