function nRxn = WriteXSQYDrvrFile(Wvl,TempK,PressureMB,XSQY_ProgramDir,RxnListFile)

nWvl = length(Wvl);

nAvogadro = 6.0222E+23;
Rgas = 8.315;
AirDen = PressureMB*1e-4*nAvogadro/Rgas/TempK; 

XSQY_Path = [XSQY_ProgramDir,'MatlabDriver.txt'];
fidWvl = fopen(XSQY_Path,'w');

nWvl =length(Wvl);

fprintf(fidWvl,'%i\n',nWvl);
for iWvl =1:nWvl-1
    fprintf(fidWvl,'%.3f\t',Wvl(iWvl));
end
fprintf(fidWvl,'%.3f\n',Wvl(nWvl));

fprintf(fidWvl,'%.3f\n',TempK);
fprintf(fidWvl,'%.3g\n',PressureMB);

nRxn = 0;
fidRxn = fopen(RxnListFile);
while ~feof(fidRxn);
    line = fgetl(fidRxn);
    fprintf(fidWvl,'%s\n',line);
    nRxn = nRxn+1;
end

fclose(fidWvl);