Match beginning of the rows

2018-05-15 12:54:52

I have a file that has thousand of lines, looking like this:

C509.TCGA-78-7159-10A-01D-2036-08.1-C509.TCGA-78-7159-01A-11D-2036-08.1 DNAH7 0 1 1 0 1 1

C509.TCGA-78-7159-10A-01D-2036-08.1-C509.TCGA-78-7159-01A-11D-2036-08.1 IRF5 0 1 1 0 1 1

C509.TCGA-78-7159-10A-01D-2036-08.1-C509.TCGA-78-7159-01A-11D-2036-08.1 ZSCAN25 1 0 0 1 0

In order to sum up columns of the rows that are starting with the same ID (C509.TCGA-78-7159-10A-01D-2036-08.1-C509.TCGA-78-7159-01A-11D-2036-08.1 e.g.) I need to match IDs and as you can see it is huge string with a lot of variability. Is there any general grep or awk command to match this IDs?