function [table,failed] = load_tab (tab_file)
% load_tab: loads a tab delimited file
failed=1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%data=dlmread(outputfile,'\t');               % load cut file
argumentlist{1}=tab_file;
argumentlist{2}='';
argumentlist{3}=[-1];
argumentlist{4}='delimiter';
argumentlist{5}=sprintf('\t');
argumentlist{6}='whitespace';
argumentlist{7}=char([8 13 32]);
argumentlist{8}='headerlines';
argumentlist{9}=[0];
argumentlist{10}='headercolumns';
argumentlist{11}=[0];
table=dataread('file',argumentlist{:});

if (size(table,2)<0)
   err_text='Input file is corrupt, please preprocess!';
   fault(err_text);
   return;
elseif (size(table,1)<1)
   err_text='Input file is empty, please preprocess!';
   fault(err_text);
   return;
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
failed=0;
return;
