I have data which has many rows like this:
| condition | result |
| -------- | -------- |
| ((a and b) or (c and d)) | Result A |
| (a or b or c) and ( d and e) and (x or (y and z)) | Result B |
which i like to convert them as:
| condition | result |
| -------- | -------- |
| (a and b) | Result A |
| (c and d) | Result A |
| (a) and ( d and e) and (x) | Result B |
| (b) and ( d and e) and (x) | Result B |
| (c) and ( d and e) and (x) | Result B |
| (a) and ( d and e) and (y and z) | Result B |
| (b) and ( d and e) and (y and z) | Result B |
| (c) and ( d and e) and (y and z) | Result B |
All the conditions are in string format.for example; condition ((a and b) or (c and d)) is in qoutes "((a and b) or (c and d))".
Basically, I want to break the single complex condition into multiple simpler conditions based on the "or" operator.
Any help would be appreciated.