I have a csv file with around 50 columns, can be anywhere between 20 and 100 rows.
The individual records have IDs, and some records can be in a group of 2. Essentially what I need to do is add an ID to the same row that another ID in that group is in. Example:
ID ,group,blank column 2019-1 , , 2019-2 ,GRP1 , 2019-3 ,GRP2 , 2019-4 ,GRP1 , 2019-5 , , 2019-6 ,GRP2 ,
And the output I would like is:
ID ,group,blank column 2019-1 , , 2019-2 ,GRP1 ,2019-4 2019-3 ,GRP2 ,2019-6 2019-5 , ,
In my attempts using awk, I haven't had any luck. I either end up leaving out rows that have no group, or I end up repeating values.