function [x,y,name] = read_xys(filename)
% Reads an SMS XYS (XY Series) file (*.xys)
%
%   [x,y,name] = read_xys(file)
%
% written by Alex Sanchez, USACE-CHL
fid = fopen(filename,'r');
hline = fgets(fid); %Skip header line
nrow = sscanf(hline,'%*s %*d %d %s',1);
ind = findstr(hline,'"');
if (ind(2)-ind(1))>1
    name = hline(ind(1)+1:ind(2)-1);
else
    name = '';
end
data = fscanf(fid,'%f %f',[2,nrow])';
fclose(fid);
x = data(:,1);
y = data(:,2);
return

