%
%
%
%
%
%
nh=2;

fi='L3_S1culture_G1.csv';
fid=fopen(fi);
header=fgetl(fid);
headers=textscan(header,'%s','delimiter',',');
headers=char(headers{:});

headers(headers(:,1)==' ',:)=[];

ncol=size(headers,1);

dat=textscan(fid,'%f','delimiter',',','headerlines',nh);

data=dat{:};

wvl=data(1:2:end);
abs=data(2:2:end);

abs=reshape(abs,ncol,length(abs)/ncol);
wvl=wvl(1:43:end);
fclose(fid);

for i=1:size(headers,1)
   
    eval([headers(i,:) '= abs(i,:);'])
    
end

clearvars -except L* wvl headers

