function [data_out header_lines]=read_asc_rhone(fname,num_header_lines)

% Open data file.
fid = fopen(fname);

% Read header lines, if any.
for i=1:num_header_lines
    tline=fgetl(fid);
    header_lines{i,1}=tline;
end

% Declare counting variable for number of data lines.
k=0;

% Loop over data.
while 1
    
    % Start counting data lines and
    % read them in.
    k=k+1;
    tline = fgetl(fid);
        
    tline_split=strsplit(tline);
    emptyCells = cellfun(@isempty,tline_split);
    
    tline_split_num=tline_split(~emptyCells);
    
    for i=1:length(tline_split_num)
       data_out(k,i)=str2num(tline_split_num{i});
    end
    
    if feof(fid)
        break
    end
    
    %num2str(data_out(k,:))
end

% Close file.
fclose(fid);

% Assign empty string to header if none
% existed.
if num_header_lines == 0
    header_lines='';
end


