function [start, labels] = read_xlabel(file)
% [start, labels] = read_xlabel(file)
%
% Read in segment start times and labels.
% Reading labels uses the 'split' function.
%
% $Id: read_xlabel.m,v 1.3 1997/08/01 15:21:02 johnson Exp johnson $
%

[e,buf] = unix(['awk ',39,'on>0 && $1!~/[a-zA-Z]/{print $1} /#/{on=1}',39,' ',file]);

% If an error is generated, return a null result.
% awk will generate the error message, so this function doesn't have to.
if e ~= 0, 
  start=[]; labels=[];
  return; 
end;

start = sscanf(buf,'%g');

if nargout>1,
	labels = split(['awk ',39,'on>0 && $1!~/[a-zA-Z]/{print $3} /#/{on=1}',39,' ',file]);
end;