Note that that is not a CSV file, because the fields are not separated by commas. Judging by the header and the two tabs per row, this is actually a tab-separated file, where the middle column consists of one long string of space-separated integers. This is easy to parse using textscan and then sscanf: opt = {'Delimiter','\t','Bufsize',pow2(14)};
[fid,msg] = fopen('temp0.txt','rt');
assert(fid>=3,msg)
hdr = regexp(fgetl(fid),'\S+','match');
C = textscan(fid,'%d%s%s',opt{:});
fclose(fid);
fun = @(s)sscanf(s,'%d').';
C{2} = cell2mat(cellfun(fun,C{2},'uni',0))
Giving:
>> hdr
hdr =
'emotion' 'pixels' 'Usage'
>> C{1}
ans =
0
0
2
>> C{2}(:,1:10)
ans =
70 80 82 72 58 58 60 63 54 58
151 150 147 155 148 133 111 140 170 174
231 212 156 164 174 138 161 173 182 200
>> C{3}
ans =
'Training'
'Training'
'Training'
Best Answer