Good day all,
I have a layer with the following fields in the attribute table:

I am trying to populate the species fields (PW, PR, PJ, SB, etc.) with the information found in the "SPCOMP" field.

All of the values that are in the “SPCOMP” field should be put into related individual species fields, and leave the rest of species fields to 0. For example, if the “SPCOMP” = “Pj 60Pt 30Bw 10”, that means that Pj=60, Pt=30, Bw=10. Then 60 should go under “PJ”, 30 goes under “PT”, and 10 goes under “BW”.
I've tried various different things through the "Calculate field" tool but have been unsuccessful.
I am thinking something like:
For field PW: if SPCOMP includes the text "Pw" return following number - omit the rest of the string, else return 0.
Obviously this is not in proper Python code, and would have to be repeated for every field.
If anyone has a solution, or Python code example to accomplish this, I would be so grateful.
Thank you