-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of EelVex Sent: Sunday, November 27, 2011 5:08 AM To: Programming forum Subject: Re: [Jprogramming] Unboxing a matrix
On Sun, Nov 27, 2011 at 9:58 AM, Skip Cave <[email protected]> wrote: > I have a 5 x 2 boxed array ts2: > > ts2 > ┌───┬────────────────┐ > │355│ freeways │ > ├───┼────────────────┤ > │356│ traffic │ > ├───┼────────────────┤ > │357│ ninety one west│ > ├───┼────────────────┤ > │358│ yes │ > ├───┼────────────────┤ > │361│ sixty │ > └───┴────────────────┘ > > $ts2 > 5 2 > > I want to unbox it so the result is a text array with carriage returns: > > 355 freeways > 356 traffic > 357 ninety one west > 358 yes > 361 sixty > > I tried lots of stuff: > ; ts2 > |domain error > | ;ts2 > > > ts2 > |domain error > | >ts2 > > , ts2 > ┌───┬─────────┬───┬────────┬───┬────────────────┬───┬────┬───┬──────┐ > │355│ freeways│356│ traffic│357│ ninety one west│358│ yes│361│ sixty│ > └───┴─────────┴───┴────────┴───┴────────────────┴───┴────┴───┴──────┘ > > Nothing seems to work. Any ideas? > > Skip > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm Define a verb that works on one row, eg like this: f =: 3 :'(":>{.y),'' '',>{:y' and then f"1 ts2 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
