clear all;
dirc = dir('*.htm');
c=size(dirc);
l2='';
for file =1:c
range=(sprinf('A%d',file));
l1 = dirc(file).name;
l3 = strcat(l2,l1);
text = fileread(l3);
text1 = lower(text);
txt = regexprep(text1,'<.*?>| |?|"|-|!|£|$|^|&|*|(|)|{|}|[|]|','');
text_tokenized = regexp (txt, '\W', 'split');
xpr = '<(\w+).*?>.*?</\1>';
ts = sort(text_tokenized);
t=transpose(ts);
[rows,cols] = size(t);
[words, coun, x] = unique(t);
coun=histc(x,1:length(coun));
count=coun';
xlswrite('tempdata.xls', count,'Sheet1',range);
end
When I try executing the program, it gives me an Error.
Error in ==> reading_file at 6 rang=(sprinf('A%d',file)); Please Let me know what is wrong.
And also Please help me by giving a snipet to store the values of count and words for all the files. (At the moment, it only displays the value of the last file).