I would like to convert a variable that combined all information about requirements for each statement and we need to make about 30 dummy variables (this is the number of special requirements). We have two types of such requirements: regular (R) and special (S). Every statement has R requirement(s) but not every has S requirements. For example for a statement: !S3, 4 !R22 which means this statement has two special requirements (#3 and #4) and one regular requirement (#22). Based on such information I need to convert it to S1=0, S2=0, S3=1, S4=1. S5=0 and R1=0, R2=0, ..., R21=0, R22=1, R23=0, ..., R25=0.
Note. the code for the type of requirement starts with ! and separate among the requirement of same type by a comma and between the two types of requirements by a space.
Could you please help me achieve such task?