function [errVec, len, indexVec, energy, sigVec] = read_dat_eng(fname)
fid = fopen(fname, 'r');
errVec(1)=0;
indexVec(1)=1;
energy(1)=1;
len = 0;
while 1>0,
  
  [indexNow, count] = fscanf(fid,'%d',1);
  if count ~= 1,
     break;
  end;
  len=len+1;
  indexVec(len) = indexNow;
  [com, count] = fscanf(fid,'%s',3);
  if count ~= 3,
     break;
  end
  sigVec(len) = fscanf(fid,'%f',1);
  [com, count] = fscanf(fid,'%s',2);
  if count ~= 2,
     break;
  end
  energy(len) = fscanf(fid,'%f',1);
  [com, count] = fscanf(fid,'%s',2);
  if count ~= 2,
     break;
  end
  errVec(len) = fscanf(fid,'%f',1);
end;
fclose(fid);
return;
