Coloring object by using a matrix

There are 1,000 objects in my Blender model.
I want to color them by certain criteria and have a “color matrix” for them (1000*2). I want to allocate color for each number in the matrix (0~15)
By using ChatGPT, I have attempted to conduct this, but I cannot proceed more. How can I do this?
Thank you for reading my post. Thank you.

Hello, would you mind sharing the content of your text file ? It is impossible to predict how to parse the file without seeing what it contains.

Thank you for your help! I really appreciate it.
But I am a new user so I cannot attach a new file. Here is a part of the context as follows.

Particle_sphere.1 6
Particle_sphere.2 3
Particle_sphere.3 8
Particle_sphere.4 6
Particle_sphere.5 8
Particle_sphere.6 8
Particle_sphere.7 6
Particle_sphere.8 5
Particle_sphere.9 6
Particle_sphere.10 11
Particle_sphere.11 11
Particle_sphere.12 0
Particle_sphere.13 8
Particle_sphere.14 9
Particle_sphere.15 6
Particle_sphere.16 5
Particle_sphere.17 5
Particle_sphere.18 10
Particle_sphere.19 4
Particle_sphere.20 8
Particle_sphere.997 5
Particle_sphere.998 8
Particle_sphere.999 5
Particle_sphere.1000 5