in reply to join column 3 for unique values

hello_beginner, Let me try to be helpful, without doing your homework for you. Store your data in a hash of arrays (use column 1 as the hash key). Show us what you have done and how it failed. I see that your output contains field 2 data which is not mentioned in your spec. - Explain. You can improve the appearance of your post by enclosing your input and output in code tags.
Bill
  • Comment on Re: join column 3 values of unique values in column 1

Replies are listed 'Best First'.
Re^2: join column 3 values of unique values in column 1
by hello_beginner (Novice) on Sep 05, 2016 at 14:13 UTC

    reading from table below data

    __DATA__

    A1 abc yellow

    B1 xyz green

    A2 cde red

    A1 abc green

    A2 cde yellow

    A1 abc blue

    OUTPUT

    A1 abc Yellow:green:blue

    B1 xyz green

    A2 cde red:yellow

      You still have not addressed my important question about field 2. Can we be certain that all input entries which have the same field 1 will have the same field 2? If not, how do you handle it? Report an error? Make separate output lines for each field 1/field 2 combination? Arbitrarily choose one of the field 2 values for the output?
      Bill

        yes, the column 2, 5,6 values will be same for unique col 1 values.