Associative array processing



I have a large number of files with varying combinations of strings in
them such as the following:

File1
A
B
C

File2
A
C
D

File3
D
E
F

From this, I need to produce something like the following:

,File1,File2,File3
A,Yes,Yes,No
B,Yes,No,No
C,Yes,Yes,No
D,No,Yes,Yes
E,No,No,Yes
F,No,No,Yes

I can do this by setting up two loops, one inside the other, but this
is tedious and time-consuming given the volumes involved. I suspect
this can be done easily and efficiently in an array but not sure how
to do it.

Any suggestions?

- CDM
.