function [Wvl,XSQY,jlabel,RxnNumber] = ReadXsqyTUV53(XSQY_OutputPath,nRxn)

%XSQY_OutputPath = [XSQY_ProgramDir,'XSQY.txt']
% comma dilemited output
fidXSQY = fopen(XSQY_OutputPath,'r');

line = fgetl(fidXSQY);
line = fgetl(fidXSQY);

% line = fgetl(fidXSQY);
% [token, remain] = strtok(line,':');
% remain = strrep(remain,':','');
% TempC = str2num(strrep(remain('C','')))
% line = fgetl(fidXSQY);
% [token, remain] = strtok(line,':');
% remain = strrep(remain,':','');
% PressMB = str2num(strrep(remain('mb','')))

lineRxnNum = fgetl(fidXSQY);
[discard, line ] =strtok(lineRxnNum);
[discard,line ] =strtok(line);
for iRxn = 1:nRxn
    [token, line] = strtok(line,',');
    RxnNumber(iRxn) = str2num(token);
end    
    
lineLabel = fgetl(fidXSQY); 
[discard, remain ] =strtok(lineLabel,',');      
for iRxn = 1:nRxn
    [token, remain] = strtok(remain,',');
    jlabel(iRxn).txt = strrep(strrep(token,' ',''),',','');
end

formatString = '%f';
for i = 1:nRxn
    formatString = [formatString,',%f'];
end


ReadData = textscan(fidXSQY,formatString);


Wvl = ReadData{1};
nWvl = length(Wvl);
XSQY = zeros(nRxn,nWvl);




XSQY = zeros(nRxn,nWvl);
for iRxn= 1:nRxn
   XSQY(iRxn,:) = ReadData{iRxn+1};
end

fclose(fidXSQY);