From: tony evans on
Hi,
I would like to know how to load in data (just one column) from a bunch of .csv files.
The files are in a format similar to this: 21-08-10_test_conditions_ROC1_rig.csv

I want to be able to just pull out data from files with R0 (row zero) for example but I can't figure out how to use wildacrds in the filename correctly.
Thanks
From: us on
"tony evans" <guitar_guy123(a)hotmail.com> wrote in message <i3r8ac$d27$1(a)fred.mathworks.com>...
> Hi,
> I would like to know how to load in data (just one column) from a bunch of .csv files.
> The files are in a format similar to this: 21-08-10_test_conditions_ROC1_rig.csv
>
> I want to be able to just pull out data from files with R0 (row zero) for example but I can't figure out how to use wildacrds in the filename correctly.
> Thanks

one of the many solutions

flst=dir('*.csv');
flst={flst.name};
% now, let's assume FLST has these entries
flst={
'foo_conditions_ROC1_rig.csv'
'test_conditions_R1C1_rig.csv'
'21-08-10_test_conditions_ROC1_rig.csv'
'21-08-10_test_conditions_ROOC1_rig.csv'
'21-08-10_test_conditions_ROPC1_rig.csv'
'21-08-10_test_conditions_R1PC1_rig.csv'
'21-08-10_test_conditions_RROPC1_rig.csv'
};
ix=regexp(flst,'ions_ROC');
ix=~cellfun('isempty',ix);
flst=flst(ix)
%{
% flst =
'foo_conditions_ROC1_rig.csv'
'21-08-10_test_conditions_ROC1_rig.csv'
%}

us