hi,
I have ran this code since more than 4 hours ,and did not complete yet. where is the problem ?
I read 1000 files, but the running time in unreasonable:
%%%%%%%%%%%%%%%%%%5
arr1=sparse(1000,232944);targetdir = 'd:\social net\dataset\netflix\netflix_2\training_set';%%nofusers=480189
targetfiles = '*.txt';fileinfo = dir(fullfile(targetdir, targetfiles));for i = 1:1000 thisfilename = fullfile(targetdir, fileinfo(i).name); f = fopen(thisfilename,'r'); c = textscan(f, '%f %f %s', 'Delimiter', ',', 'headerLines', 1); fclose(f); c1=sparse(length(c));c2=sparse(length(c1));c3=sparse(length(c)); c1 = c{1}; c3=c{3}; L(i)=length(c1); format long dat=round(datenum(c3,'yyyy-mm-dd')); arr=[c1 dat]; arr1(i,1:L(i)*2)=reshape(arr.',1,[]); end
Best Answer