These are nice but while they avoid the duplicate rows issue they lack the
appealing row header format of the original.  The following is a start in
that direction using Marshall's 2nd approach,

   v=. (3&{. , _2 {:\ 2&}.)@":

   v (;:'a b c d'),,~]&.>p:p:p:i.4 4
┌────┬────┬────┬────┐
│a   │b   │c   │d   │
├────┼────┼────┼────┤
│13  │19  │43  │71  │
│163 │193 │293 │359 │
│463 │619 │743 │971 │
│1091│1181│1423│1601│
│13  │19  │43  │71  │
│163 │193 │293 │359 │
│463 │619 │743 │971 │
│1091│1181│1423│1601│
└────┴────┴────┴────┘



On Thu, Jul 16, 2015 at 3:29 AM, Linda Alvord <[email protected]>
wrote:

> Here’s a little early morning puzzler:
>
>
>
>  ]A=:": (;:'a b c d'),]&.>p:p:p:i.4 4
>
> ┌────┬────┬────┬────┐
> │a   │b   │c   │d   │
> ├────┼────┼────┼────┤
> │13  │19  │43  │71  │
> ├────┼────┼────┼────┤
> │163 │193 │293 │359 │
> ├────┼────┼────┼────┤
> │463 │619 │743 │971 │
> ├────┼────┼────┼────┤
> │1091│1181│1423│1601│
> └────┴────┴────┴────┘
>
>
>
>    4 6{A
>
> ├────┼────┼────┼────┤
> ├────┼────┼────┼────┤
>
>    5 7{A
>
> │163 │193 │293 │359 │
> │463 │619 │743 │971 │
>
>    4 5 6{A
>
> ├────┼────┼────┼────┤
> │163 │193 │293 │359 │
> ├────┼────┼────┼────┤
>
>
>
> Linda
>
>
>
>
>
> -----Original Message-----
> From: [email protected] [mailto:
> [email protected]] On Behalf Of Linda Alvord
> Sent: Thursday, July 16, 2015 2:35 AM
> To: [email protected]
> Subject: Re: [Jprogramming] minor note: csv data
>
>
>
> ( <mailto:#~2|i.@#> #~2|i.@#) A=:": (;:'a b c d'),]&.>p:p:p:i.4 4
>
> │a   │b   │c   │d   │
>
> │13  │19  │43  │71  │
>
> │163 │193 │293 │359 │
>
> │463 │619 │743 │971 │
>
> │1091│1181│1423│1601│
>
>    f=:13 :'(#~2|[:i.#) y'
>
>       g=: 13 :'((2|[:i.#)y)#y'
>
>    (f A)-:g A
>
> 1
>
>    f
>
> #~ (2 | [: i. #)
>
>    g
>
> ] #~ 2 | [: i. #
>
>
>
> Linda
>
>
>
> -----Original Message-----
>
> From:  <mailto:[email protected]>
> [email protected] [ <mailto:
> [email protected]> mailto:
> [email protected]] On Behalf Of Marshall Lochbaum
>
> Sent: Wednesday, July 15, 2015 8:35 PM
>
> To:  <mailto:[email protected]> [email protected]
>
> Subject: Re: [Jprogramming] minor note: csv data
>
>
>
> That's pretty clever. I like using
>
>
>
>    ( <mailto:#~2|i.@#> #~2|i.@#) ": (;:'a b c d'),]&.>p:p:p:i.4 4
>
> │a   │b   │c   │d   │
>
> │13  │19  │43  │71  │
>
> │163 │193 │293 │359 │
>
> │463 │619 │743 │971 │
>
> │1091│1181│1423│1601│
>
>
>
> although now that it's come up, I realize (_2{:\}: ": ...) is a little
> shorter. Either way, it lets you dodge the problem with non-unique rows but
> at the cost of quite a few characters. Thanks for this version though--I am
> sure I will end up using it!
>
>
>
> Marshall
>
>
>
> On Wed, Jul 15, 2015 at 03:33:18PM -0400, Raul Miller wrote:
>
> > I've been using ~.": a lot lately, when working with csv data (with a
>
> > header row).
>
> >
>
> > Here's what that looks like:
>
> >
>
> >    ~.": (;:'a b c d'),]&.>p:p:p:i.4 4
>
> > ┌────┬────┬────┬────┐
>
> > │a   │b   │c   │d   │
>
> > ├────┼────┼────┼────┤
>
> > │13  │19  │43  │71  │
>
> > │163 │193 │293 │359 │
>
> > │463 │619 │743 │971 │
>
> > │1091│1181│1423│1601│
>
> > └────┴────┴────┴────┘
>
> >
>
> > of course, that will be mangled if you're using a proportionally
>
> > spaced font or have other font issues. But in a good fixed width font,
>
> > you get a more compact display than boxed.
>
> >
>
> > This wouldn't work right if rows of data were duplicated, but that
>
> > would be garbage data in the contexts I've been working with. So for
>
> > me that's a non-issue.
>
> >
>
> > Anyways, this might work for someone else, also...
>
> >
>
> > FYI,
>
> >
>
> > --
>
> > Raul
>
> > ----------------------------------------------------------------------
>
> > For information about J forums see  <http://www.jsoftware.com/forums.htm>
> http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
>
> For information about J forums see  <http://www.jsoftware.com/forums.htm>
> http://www.jsoftware.com/forums.htm
>
>
>
> ----------------------------------------------------------------------
>
> For information about J forums see  <http://www.jsoftware.com/forums.htm>
> http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to