function [F,T,D] = featread(N)
% [F,T,D] = featread(N)  Read meapsoft feature file
%   N is the name of MEAPsoft feature file i.e. lines of 
%     file.wav starttime durtime ftr0 ftr1 ftr2 ...
%   F returns a cell array of the filenames for each segment.
%   T returns rows of <start> <dur> for each segment.
%   D returns rows as the actual feature values for each segment.
% 2006-03-27 dpwe@ee.columbia.edu

%[f,s,e,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10] = textread('Aimee.feat','%s%f%f%f%f%f%f%f%f%f%f%f%f%*[^\n]','commentstyle','shell');

h = fopen(N);

ln = 1;
while (feof(h) == 0)
  l = fgetl(h);
  if ischar(l)
    if l(1) ~= '#'
      [fn,ct,err,nxt] = sscanf(l,'%s',1);
      [dd,ct,err,nxt] = sscanf(l(nxt:end),'%f');
      F{ln} = fn;
      T(ln,:) = dd(1:2);
      D(ln,:) = dd(3:end);
      ln = ln+1;
    end
  end
end

fclose(h);
