Your solution could be shortened a bit to

   <"1|:<"0  S:1[ 1 2 3 4 ; 5 6 7 8 ; <'a';'b';'c';'d'
+---------+---------+---------+---------+
|+-+-+---+|+-+-+---+|+-+-+---+|+-+-+---+|
||1|5|+-+|||2|6|+-+|||3|7|+-+|||4|8|+-+||
|| | ||a|||| | ||b|||| | ||c|||| | ||d|||
|| | |+-+||| | |+-+||| | |+-+||| | |+-+||
|+-+-+---+|+-+-+---+|+-+-+---+|+-+-+---+|
+---------+---------+---------+---------+
  

R.E. Boss

(Add your info to http://www.jsoftware.com/jwiki/Community/Demographics )


> -----Original Message-----
> From: [email protected] [mailto:programming-
> [email protected]] On Behalf Of Pascal Jasmin
> Sent: vrijdag 11 oktober 2013 15:48
> To: [email protected]
> Subject: [Jprogramming] Scanning (/ or looping) records of an inverted table
> 
> with 4 row 3 column inverted table
> 
>    1 2 3 4 ; 5 6 7 8 ; <'a';'b';'c';'d'
> ┌───────┬───────┬─────────┐
> │1 2 3 4│5 6 7 8│┌─┬─┬─┬─┐│
> │       │       ││a│b│c│d││
> │       │       │└─┴─┴─┴─┘│
> └───────┴───────┴─────────┘
> 
> is there a way to scan through each record without doing this:
> 
>    <"1 &.|: > <"0 each 1 2 3 4 ; 5 6 7 8 ; <'a';'b';'c';'d'
> ┌─────────┬─────────┬─────────┬─────────┐
> │┌─┬─┬───┐│┌─┬─┬───┐│┌─┬─┬───┐│┌─┬─┬───┐│
> ││1│5│┌─┐│││2│6│┌─┐│││3│7│┌─┐│││4│8│┌─┐││
> ││ │ ││a││││ │ ││b││││ │ ││c││││ │ ││d│││
> ││ │ │└─┘│││ │ │└─┘│││ │ │└─┘│││ │ │└─┘││
> │└─┴─┴───┘│└─┴─┴───┘│└─┴─┴───┘│└─┴─┴───┘│
> └─────────┴─────────┴─────────┴─────────┘
> 
> I was hoping for some version/combination of L: S: but I can't say I
> understand S:
> 
>   test =. 4 : 'a;b;<c [b=. b+ a [''a b c'' =. x'
>     2 test  each/\ <"1 &.|: > <"0 each 1 2 3 4 ; 5 6 7 8 ; <'a';'b';'c';'d'
> ┌─────────┬─────────┬──────────┐
> │┌─┬─┬───┐│┌─┬─┬───┐│┌─┬──┬───┐│
> ││1│6│┌─┐│││2│8│┌─┐│││3│10│┌─┐││
> ││ │ ││a││││ │ ││b││││ │  ││c│││
> ││ │ │└─┘│││ │ │└─┘│││ │  │└─┘││
> │└─┴─┴───┘│└─┴─┴───┘│└─┴──┴───┘│
> └─────────┴─────────┴──────────┘
> 
> 
> 
> Maybe  <"1 &.|: > <"0 each is actually really good?
> ----------------------------------------------------------------------
> 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