Yes I'm counting from 0. Note that I didn't say the 1st or 3rd item.
Item 1 comes after Item 0 and before Item 2.

On Wed, Feb 29, 2012 at 9:47 PM, Linda Alvord <lindaalv...@verizon.net> wrote:
> Are you counting from 0 ?  That looks like the 4th row to me.
>
> Linda
>
> -----Original Message-----
> From: programming-boun...@jsoftware.com
> [mailto:programming-boun...@jsoftware.com] On Behalf Of PackRat
> Sent: Tuesday, February 28, 2012 11:50 PM
> To: Programming forum
> Subject: [Jprogramming] Amend situation how-to?
>
> I have a table "b" (example below) which is the transpose of table "a"
> which is read in from a file.  Here's what table b looks like, just so
> you have an idea of what's where:
>
> +--------+-----------+--------+--------+-----------+...
> |F       |CAT        |DE      |CSX     |XOM        |...
> +--------+-----------+--------+--------+-----------+...
> |Ford    |Caterpillar|Deere   |CSX     |Exxon Mobil|...
> +--------+-----------+--------+--------+-----------+...
> |3710    |665        |410     |890     |4000       |...
> +--------+-----------+--------+--------+-----------+...
> |19560307|19291202   |19330609|19801103|19991201   |...
> +--------+-----------+--------+--------+-----------+...
> |0       |0          |0       |0       |0          |...
> +--------+-----------+--------+--------+-----------+...
> |0       |0          |0       |0       |0          |...
> +--------+-----------+--------+--------+-----------+...
>
> The problem I'm having is with amending individual cells in both row 4
> and row 5 (the last two rows) of table b.  (I've run into this problem
> before, but I created lengthy workarounds which are not really J-ish.
> I decided this time to ask the wisdom of the J community to finally
> find out once and for all what the "right" way of doing this kind of
> thing is.)
>
> I don't run into problems READING an individual cell, such as:
>
>   stocksym=. toupper > (j { 0 { b)
>
> However, when I attempt to WRITE an amend into the jth (e.g., first)
> cell of row 4 of table b, for example:
>
>   b=. (< stocknum) j } (4 { b)
>
> table b is incorrectly changed (compared to my intent, that is) from
> the table shown above to a list instead:
>
>   +-+-+-+-+-+...
>   |6|0|0|0|0|...
>   +-+-+-+-+-+...
>
> Is there some "standard" way of making such amends within a table that
> I seem to be missing somewhere along the line?  Thanks for your help!
>
>
> Harvey
>
> ----------------------------------------------------------------------
> For information about J forums see 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