On Mon, Aug 13, 2012 at 5:13 AM, Linda Alvord <[email protected]> wrote:
> How can I amend adjacent columns to remove duplicates?
>
>     2 10$'ABCDEEEFGH'
> ABCDEEEFGH
> ABCDEEEFGH
>
>    2 7$'ABCDEFG'
> ABCDEFG
> ABCDEFG

Note that "amend" is a J primitive which preserves the shape of its
right argument, so I am going to presume that you are only hinting at
what you want done here.

If you can relax the "adjacent" part, it's simple:

   ~.&.|: 2 10$'ABCDEEEFGH'
ABCDEFGH
ABCDEFGH

If you really need to preserve duplicate columns which are not a part
of an adjacent sequence, the complications that Henry spelled out will
accomplish that task.

FYI,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to