Currently my dataset is as:
| ID | value |
|---|---|
| 1 | str1/value1,str2/value21,value22,value23,str3/value31,value32 |
| 2 | str4/value4,str5/value51,value52,value53,str6/value61,value62 |
I want to first split data on a comma (',') and then on the ('/'), but I want to keep all the occurrences after '/' with a comma. Also, I need to split them into row values.
The output should be:
| ID | str | value |
|---|---|---|
| 1 | str1 | value1 |
| 1 | str2 | value21,value22,value23 |
| 1 | str3 | value31,value32 |
| 2 | str4 | value4 |
| 2 | str5 | value51,value52,value53 |
| 2 | str6 | value61,value62 |
Please can somebody help me do it in an efficient way, instead of looping it for each and every occurrence.