And hopefully final, more elegant solution :)
dlgfile gr:=*.dat mu:=1; //select files to import
string file$;
newbook;
%A = %H; //remember book
loop(ii,1,fname.GetNumTokens(CRLF))
{
file$ = fname.GetToken(ii,CRLF)$; //find file
impasc fname:=file$ //import file
options.ImpMode:=4 //new sheet for each import
options.Names.FNameToBk:=0; //dont rename book
window -a %A;
wks.col2.type= 4; //set col(2) to X
normalize col(3);
stats col(10); //make statistics of col(10)
col(11) = col(10)-stats.mean + ii -1;
%A!wks.col11.label$= "Intensity/arb.u.";
%B = page.active$;
if (ii == 1){
plotxy [%A]%B!(2,11)
plot:=200 //plot as line
legend:=0; //don't plot the legend
%K=%H; //get graph name
}
if (ii > 1) {
plotxy [%A]%B!(2,11)
plot:=200 //plot as line
ogl:=[%K]1! //plot to the same graph layer 1
legend:=0; //don't plot the legend
}
}
dlgfile gr:=*.dat mu:=1; //select files to import
string file$;
newbook;
%A = %H; //remember book
loop(ii,1,fname.GetNumTokens(CRLF))
{
file$ = fname.GetToken(ii,CRLF)$; //find file
impasc fname:=file$ //import file
options.ImpMode:=4 //new sheet for each import
options.Names.FNameToSht:=1 //dont rename sheet
options.Names.FNameToBk:=0; //dont rename book
window -a %A;
wks.col2.type= 4; //set col(2) to X
normalize col(3);
stats col(10); //make statistics of col(10)
col(11) = col(10)-stats.mean + ii -1;
%A!wks.col11.label$= "Intensity/arb.u.";
%B = page.active$;
if (ii == 1){
plotxy [%A]%B!(2,11)
plot:=200 //plot as line
legend:=0; //don't plot the legend
%K=%H; //get graph name
}
if (ii > 1) {
plotxy [%A]%B!(2,11)
plot:=200 //plot as line
ogl:=[%K]1! //plot to the same graph layer 1
legend:=0; //don't plot the legend
}
}