%
% 12.03.2001, c
%
function [nRec, rec] = loadRecords( fileName, names, desc );

file = fopen( fileName, 'rt' );

nRec = fscanf( file, '%d', 1 );
nF = size( desc, 1 )

tmp = 0;
for ir = 1:nRec
  for ii = 1:nF
    aux = fscanf( file, desc{ii,1}, desc{ii,2} );
    tmp = setfield( tmp, names{ii}, aux );
  end
  rec(ir) = tmp;
end

fclose( file );
