function [of mf sf]=subFileLines(mfn,sfn,linerange)
% subFileLines <Substitute lines linerange in modfile with lines in subfile.>
% Usage:: err=subFileLines(modfile,subfile,linerange[[1 1]])
%

% revision history:
% 05/04/20 Mark D. Shattuck <mds> subFileLines.m

%% Parse Input
if(~exist('linerange','var') || isempty(linerange))
	linerange=[1 1];
end

%% Main
lb=linerange(1);
le=linerange(2);

mf=loadTxt(mfn);
sf=loadTxt(sfn);
of=[mf(1:lb-1);sf;mf(le+1:end)];
fid=fopen(mfn,'w+');
fprintf(fid,'%s\n',of{:});
fclose(fid);
