Lets say I have these many rows
chr1 66999638 66999638 SGIP1 1 +
chr1 66999251 66999251 SGIP1 1 +
chr1 33545778 33549778 AZIN2 1 +
chr1 8376144 8380144 SLC45A1 1 +
chr1 16765166 16769166 NECAP2 1 +
chr1 33544713 33548713 AZIN2 1 +
chr1 25069759 25073759 CLIC4 1 +
chr1 33544729 33548729 AZIN2 1 +
chr1 50487626 50491626 AGBL4 1 -
chr1 92349836 92353836 TGFBR3 1 -
Expected output:
chr1 66999638 66999638 SGIP1 1 +
chr1 66999251 66999251 SGIP1_1 1 +
chr1 33545778 33549778 AZIN2 1 +
chr1 83761448380144 SLC45A1 1 +
chr1 16765166 16769166 NECAP2 1 +
chr1 33544713 33548713 AZIN2_1 1 +
chr1 25069759 25073759 CLIC4 1 +
chr1 33544729 33548729 AZIN2_2 1 +
chr1 50487626 50491626 AGBL4 1 -
chr1 92349836 92353836 TGFBR3 1 -
I would like a way to alter the second row (and 3rd, 4th, etc.) which is duplicated in column $4. I simply want to add a "_1" string so it reads "SGIP_1" or "WhateverGeneName_1".
Preferably an awk or sed solution would be best. Thanks so much in advance.
foo_1
or should only those names that occur more than once be modified?