(1) If the input proceeds from
Gen x a, Gen x b to Gen y c and then to Gen x d, in the desired output do you want exactly one line for Gen x, i.e. Gen x a,b,d? or do you want Gen x a,b, Gen y c, Gen x d? (2) It seems the first field is totally irrelevant and shall just be ignored. Please confirm. (3) In the input there is 1;2, but the desired output "fixes" it to 1:2. Do you need the code to fix such things? (4) The dots in your awk code are very wrong. (5) The answer to "can awk?" is "yes". If your real question is "how can I do it with awk?" then you shall ask this.