I did it myself again(I am always surprised with what J affords to me), but still looking for more elegant solutions.
enclose=.'||' ,"1~ '||' ,"1 > bar=.[: <"1 ([: > [) ,"1 '||' ,"1 [: > ] t +-----+---------+-----+ |abc |xyzxyz |abc | +-----+---------+-----+ |def |xyz |def | +-----+---------+-----+ |g |xyz |g | +-----+---------+-----+ |hijkl|xyzxyz |hijkl| +-----+---------+-----+ |mn |xyzxyzxyz|mn | +-----+---------+-----+ (enclose@(bar/)@|:) t ||abc ||xyzxyz ||abc || ||def ||xyz ||def || ||g ||xyz ||g || ||hijkl||xyzxyz ||hijkl|| ||mn ||xyzxyzxyz||mn || On 3/24/06, June Kim <[EMAIL PROTECTED]> wrote: > Or more generally, > > vbar a ,. b NB. vbar's y values can be any size of 2d table > ||abc ||xyzxyz || > ||def ||xyz || > ||g ||xyz || > ||hijkl||xyzxyz || > ||mn ||xyzxyzxyz|| > > It was relatively easy to work on "a bar b" but this one is more > difficult. Could anyone help out? > > On 3/24/06, June Kim <[EMAIL PROTECTED]> wrote: > > Sorry for any confusion I made. > > > > The result's separator between cells should be two vertical bars, ie. '||' > > > > So, > > a,&(]&.:>)b > > +-----+---------+ > > |abc |xyzxyz | > > |def |xyz | > > |g |xyz | > > |hijkl|xyzxyz | > > |mn |xyzxyzxyz| > > +-----+---------+ > > > > isn't what I'm looking for. It should be instead: > > > > a verticalbar b > > ||abc ||xyzxyz || > > ||def ||xyz || > > ||g ||xyz || > > ||hijkl||xyzxyz || > > ||mn ||xyzxyzxyz|| > > > > > > Suppose you are to copy and paste the result into the J wiki and also > > let it stay easy to modify when in edit mode. > > > > > > > > On 3/24/06, Miller, Raul D <[EMAIL PROTECTED]> wrote: > > > p j wrote: > > > > a=.'abc';'def';'g';'hijkl';'mn' > > > > b=.'xyzxyz';'xyz';'xyz';'xyzxyz';'xyzxyzxyz' > > > > a,.b > > > > You see the table. What I want instead is, something like, > > > ... > > > > > > I don't completely understand what you are asking for, even > > > with the visual example. > > > > > > Could you comment on how this differs from what you want? > > > > > > a,&(]&.:>)b > > > > > > Thanks, > > > > > > -- > > > Raul > > > ---------------------------------------------------------------------- > > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
