Hi,
I am using the strtok function to cut out a certain part of my strings. I have a lot of filenames with the exact string in the beginning of the name and would like to get out the last part of the string.
Eg: Filenmes{1,1} = 'ID_setup_CMJ_L_2' Filenmes{2,1} = 'ID_setup_DJ_R_1'
So I want to get something like:
Names{1,1} = 'CMJ_L_2' Names{2,1} = 'DJ_R_1'
I use the following line for this:
[prt1, prt2] = strtok(filenmes{i,1},'ID_setup_')
It works fine for all of my filenames except for the DJ's.. then it gives me Names({2,1} = 'J_R_1' (instead of DJ_R_1).
Thus, it cuts out that 'D' which it does not do in all of my other examples (CMJ,NonCMJ,HH,…)
Any suggestions? Are there perhaps better ways to do this?
Thanks!
Best Answer