in reply to Re: join column 3 for unique values
in thread join column 3 for unique values

Great, this works.

If there is duplicate value for A1, like below Yellow, it reapts. we need i to print only once </>

__DATA__

A1 abc yellow

A1 abc yellow

A2 cde yellow

A1 abc blue

Output:

A1 abc yellow:yellow:blue ---only yellow:blue

A2 cde yellow

B1 xyz green

Replies are listed 'Best First'.
Re^3: join column 3 for unique values
by stevieb (Canon) on Sep 05, 2016 at 15:30 UTC

    You'll need to show a little effort here now. Hint: check the array if the colour already exists before pushing it onto itself, perldoc -f grep, or use a hash for the colours as well, if the order doesn't matter.

    update: Also, please see How do I post a question effectively? for the use of <code></code> tags (they are for code *and* data), and use the Preview button to ensure all of your tags are closed etc.