Sorry I am very new to Linux and I am uncertain the capability of bash for what I want to achieve.
I want to merge column-2 values if column-1 and column-3 values are identical. In this case, if there are same error descriptions and same merchant, I want to merge RefNo fields by comma.
Error Desc|RefNo|Merchant
===================================
Category code invalid|03077|merchanta
Category code invalid|09877|merchanta
Invalid ID|12345|merchanta
Invalid ID|07323|merchantc
Invalid ID|03523|merchantc
No valid reason|78653|merchantb
Expected outcome:
Error Desc|RefNo|Merchant
===================================
Category code invalid|03077,09877|merchanta
Invalid ID|12345|merchanta
Invalid ID|07323,03523|merchantc
No valid reason|78653|merchantb
Similar posts I've found but it's removing duplicate and I don't want to remove and merge the column-2 instead. Keeping unique rows based on information from 2 of three columns.