I have a document with lots of Heading 1 Heading 2

I want to search all the Heading 1 and only keep the first instance of each e.g.

The document is laid out like this


Heading 1 - ABC
Heading 2 - xxx
Heading 1 - ABC
Heading 2 - xxy
Heading 1 - ABC

Heading 2 - xxz
Heading 1 - CBA
Heading 2 - xxx

There are 100s of instances like this, I want this to become like below:

Heading 1 - ABC
Heading 2 - xxx
Heading 2 - xxy
Heading 2 - xxz
Heading 1 - CAB
Heading 2 - xxx

So need to count the number of unique entries of heading 1's and only keep the first instance.

Thanks