KoenDV
Electrical
- Nov 15, 2006
- 1
Hey,
I'm really stuck on this. I'm trying to use regexp twice once for all the files i need to work with and then again to narrow it down even more.
textfiles = dir('*.txt');
filenames = {textfiles.name};
filenames = regexp(filenames, '^sn\d{4}_INS_(LOW|HIGH)_\d+_\d+_(A|B).txt$', 'match');
startfilenames = regexp(filenames, '^sn\d{4}_INS_LOW_\d+_\d+_A.txt$', 'match');
After the first regexp filenames seems to be a cell array. It needs to be an cell array of string to be used by regexp again. I tried tons of thing like char, cellstr, cell, iscell, iscellstr... Tried some functions of the net and avery thing i can think of using round, square and curly brakets. So can anyone please help me?
Thx
Koen
I'm really stuck on this. I'm trying to use regexp twice once for all the files i need to work with and then again to narrow it down even more.
textfiles = dir('*.txt');
filenames = {textfiles.name};
filenames = regexp(filenames, '^sn\d{4}_INS_(LOW|HIGH)_\d+_\d+_(A|B).txt$', 'match');
startfilenames = regexp(filenames, '^sn\d{4}_INS_LOW_\d+_\d+_A.txt$', 'match');
After the first regexp filenames seems to be a cell array. It needs to be an cell array of string to be used by regexp again. I tried tons of thing like char, cellstr, cell, iscell, iscellstr... Tried some functions of the net and avery thing i can think of using round, square and curly brakets. So can anyone please help me?
Thx
Koen