Parse data separated by slashes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | * By Raynald Levesque. DATA LIST LIST /a(A70). BEGIN DATA C206/E2101254/F210 E206/ABCDP206/ZF210/G210/X210 END DATA. LIST. STRING #(A70). VECTOR b(5A10). COMPUTE #=CONCAT(RTRIM(a),'/'). COMPUTE #cnt=1. LOOP IF INDEX(#,'/')>0. COMPUTE b(#cnt)=SUBSTR(#,1,INDEX(#,'/')-1). COMPUTE #cnt=#cnt + 1. COMPUTE #=SUBSTR(#,INDEX(#,'/')+1). END LOOP. EXECUTE. |
Related pages
...