Need to do a UNIQUE COUNT on records in a LARGE legacy text file that does not have field delimiters

Hi all:

I need to do a COUNT UNIQUE on records in a LARGE legacy text file that does not have field delimiters.

For example, I have this:

0001ABC2000
0002ABC3000
0003ABC4000
0004XYZ1000
0005XYZ2000
0006XYZ3000

I need a unique count on ABC and XYZ to give me a result of 2 (not 6).

Obviously performance is a requirement due to the size of the real file with records lengths of around 2000-4000 bytes and could have millions of records.

I am a PS newbie so any help is much appreciated.

TIA