I don't understand fully (did you mean 'column' instead of 'row' towards
the end?), but I'll lead with
3 2 5 {."0 1 (2) {"1 a
2 7 12 0 0
22 27 0 0 0
42 47 52 57 0
Henry Rich
Bill Harris wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm using J in my work, and I've got an array selection problem I don't
> see the answer to. All my experiments are at work, but I'll try to
> recreate something similar.
>
> I've got a rank 3 array (report) that I've pulled in from an Excel
> workbook. Each of the tables has some number of rows and a fixed number
> of columns. I've matched the data to determine how many rows I want to
> look at in each table; now I'd like to create a rank 2 or perhaps rank 3
> table (depending upon the need) that selects all the valid data in
> certain rows on certain items.
>
> That is, if
>
> ]a=: i. 3 4 5
> 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 32 33 34
> 35 36 37 38 39
>
> 40 41 42 43 44
> 45 46 47 48 49
> 50 51 52 53 54
> 55 56 57 58 59
>
> then I might want
>
> 2 7 12 0
> 22 27 0 0
> 42 47 52 57
>
> I know the numbers of the first row to drop (3 2 5 in that example) and
> the row I want (2 in that example); can you help me craft the argument
> to { to generate that?
>
> I'm content with zeros padding the remainder of the table, but I'll also
> take a boxed result with just the right number of entries in each box.
>
> Thanks,
>
> Bill
> - --
> Bill Harris http://facilitatedsystems.com/weblog/
> Facilitated Systems Everett, WA 98208 USA
> http://facilitatedsystems.com/ phone: +1 425 337-5541
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkofN2gACgkQ3J3HaQTDvd+0iwCeLgadMUh0N873ppQGij9YyKmb
> 30gAmgIt46FtCLj2Gl2fjgZFaeRpurrZ
> =wigW
> -----END PGP SIGNATURE-----
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm