% Want to extract a column of data from a text file
% that some wisard sprinkled with comments and other
% text nuisance? Think you have to go over the file 
% deleting the text entrances so that XMGR can load the
% data, hell NO. Now with this state of the art data
% extraction tool you can do it by clicking a mouse
% button in the comfort of your own desktop. And here
% is how .....
%
% dataout=extract(file_name,deliniator,command);
%
% Function EXTRACT loads a text file FILE_NAME of 
% any format with text and numerical data intermixed, 
% then it defines the blocks of numerical data where
% data entrees are separated by DELINIATOR. You
% can extract a particular data block eather manually
% by setting COMMAND='interactive' or the program can
% extract the last largest block atomatically when 
% COMMAND='last max'. It puts the data into the DATAOUT.
%
% Ex:
% dataout=extract('Example2',' ','interactive');

function dataout=extract(name,delin,command);

buffer=block_read(name);
[block,data]=block_map(buffer,delin);
[bsize,xe,ye,y,ly,x,lx]=block_filter(block,data);
switch command
	case 'interactive'
		dataout=block_extract(0,0,y,ly,x,lx,data,1);	
	case 'last max'
		dataout=block_extract(xe(1,1),ye(1,1),y,ly,x,lx,data,0);
	case 'who'
		display('Powered by Maksim Skorobogatiy');
	end
	
		
