I have a file like this:
$ cat file
rep1 rep2
g1001_INpfu_DN44908_c3_g1 17.85 19.95
g10042/1330/2846_INpfu_DN43979_c0_g3 34.07 29.19
g1077/1457/278/278_INpfu_PRJNA287145_DN42983_c0_g1 20.69 21.64
g100/100_INpfu_DN43143_c0_g1 52.36 33.64
g79/79/79/79_INpfu_DN45068_c4_g1 58.83 74.58
The text before the first "_" is group number(s), like
- g number _ ...
- g number1 / number2 _ ...
- g number1 / number2 / number3 _ ...
etc. (Spaces are added for illumination.) Having a slash means multiple groups. Sometimes there are duplicate group numbers within a line, and I want to remove them.
The expected results should be like:
rep1 rep2
g1001_INpfu_DN44908_c3_g1 17.85 19.95
g10042/1330/2846_INpfu_DN43979_c0_g3 34.07 29.19
g1077/1457/278_INpfu_PRJNA287145_DN42983_c0_g1 20.69 21.64
g100_INpfu_DN43143_c0_g1 52.36 33.64
g79_INpfu_DN45068_c4_g1 58.83 74.58
In the last three lines, the same group numbers are removed, only keeping the unique group number(s).