% [BUFFER]=BLOCK_READ(FILE_NAME) 
%
% BLOCK_READ() readsfile with the name FILE_NAME into a 
% sparse array for further processing.

function buffer=block_read(name);

[fin,message]=fopen(name,'rt');
if (fin>0)
%	fprintf(1,'-> %s %s ','Reading',name);
	linec=0;buffer=sparse(0);
	while(~feof(fin))
		lbuffer=sparse(0);
		linec=linec+1;
		lbuffer=sparse(fgetl(fin));
		buffer(linec,1:size(lbuffer,2))=lbuffer;
	end
	fclose(fin);
%    fprintf(1,'-> %s\n','done');
else
	fprintf(1,'%s\n',message);
	block=[];carray=[];
end
