it's probably not difficult if you know some basic programming (php, python etc.)
If not, maybe a member could do it for you.
Not sure it it could be done with Excel or any other program. Also hard to say without seeing the data.
You can filter CCTLDs if you filter anything that has 2 characters after the last dot in the domain.
Then for the legacy TLDs you need to come up with a list manually but that should not be difficult and then filter out all extensions that are in the list.
Any remaining domain that contains more than 1 dot is a subdomain and needs to be filtered out as well.