Try
len = 1e5;
str = '2013-12-10, 00:01:02, 1,2,3,4,5,6,7,8,9,0';
fid = fopen( 'c:\m\cssm\data_2.txt', 'w' );
for jj = 1 : len
fprintf( fid, '%s\n', str );
end
fclose( fid );
tic
fid = fopen( 'c:\m\cssm\data_2.txt', 'r' );
cac = textscan( fid, '%s%s%f%f%f%f%f%f%f%f%f%f' ...
, 'CollectOutput',true, 'Delimiter', ',' );
fclose( fid );
toc
tic
buf = cell2mat( cac{1} );
sdn = datenum( buf, 'yyyy-mm-ddHH:MM:SS' );
toc
I get
Elapsed time is 0.782288 seconds.
Elapsed time is 1.648444 seconds.
If you have 1GB extra ram for the data, it will scale nicely.
Best Answer