I have a file with three columns, and I need to remove lines that contain specific duplicated field.
1 V(Cl8) 2.121
2 V(C1,H3) 2.067
3 V(Cl7) 2.121
4 V(Cl7) 1.347
5 V(C4,H6) 2.067
6 V(Cl8) 1.347
7 V(Cl8) 0.918
8 V(C1,Cl7) 1.220
9 V(C4,Cl8) 1.220
10 V(Cl7) 0.918
11 V(C1,C4) 1.958
12 C(Cl8) 7.668
13 C(Cl7) 7.668
14 C(C1) 2.087
15 C(C4) 2.087
16 C(Cl8) 2.267
17 C(Cl7) 2.267
18 V(C1,H2) 2.067
19 V(Cl8) 2.122
20 V(Cl7) 2.122
21 V(C4,H5) 2.067
I need to remove the lines that contain repeated C(Cl8) and C(Cl7), so that I only have one occurrence of each in the output.
I tried commands like sort and uniq, but all the duplicated strings are removed.
The desired output (note that I don't care which occurrence is kept, I only care that I have just one C(Cl8) and one C(Cl7):
1 V(Cl8) 2.121
2 V(C1,H3) 2.067
3 V(Cl7) 2.121
4 V(Cl7) 1.347
5 V(C4,H6) 2.067
6 V(Cl8) 1.347
7 V(Cl8) 0.918
8 V(C1,Cl7) 1.220
9 V(C4,Cl8) 1.220
10 V(Cl7) 0.918
11 V(C1,C4) 1.958
13 C(Cl7) 7.668
14 C(C1) 2.087
15 C(C4) 2.087
16 C(Cl8) 2.267
18 V(C1,H2) 2.067
19 V(Cl8) 2.122
20 V(Cl7) 2.122
21 V(C4,H5) 2.067