Hey, i just got a brief question about an issue i did not find an answer after around 2 days of searching in origin-forums.
The Situation is the following: I work in the field of organic photovoltaics, where i generate multiple measurement files.
I want to automatically import the files into one worksheet - for the first file, the first and the second column should be imported as x and y values.
For all following files, only the second column should be imported as y-values.
I did already succeed with that, using the following Code:
string fns, path$ = "C:\Users\myname\Desktop\OriginTest\";
findfiles f:=fns$ ext:="*.dat";
int numFiles = fns.GetNumTokens(LF);
for(int ifile = 1; ifile <= numFiles; ifile++){
if(ifile==1){
string strToken$ = fns.GetToken(ifile)$;
strToken$=;
impasc fname:=strToken$
options.PartImp.Partial:=0
options.PartImp.FirstCol:=2
options.Sparklines:=0
options.Names.AutoNames:=0
options.Names.FNameToSht:=1
options.ImpMode:=1
options.Miscellaneous.LeadingZeros:=1;
}
else if(ifile>1){
string strToken$ = fns.GetToken(ifile)$;
strToken$=;
impasc fname:=strToken$
options.PartImp.Partial:=1
options.PartImp.FirstCol:=2
options.Sparklines:=0
options.Names.AutoNames:=0
options.Names.FNameToSht:=1
options.ImpMode:=1
options.Miscellaneous.LeadingZeros:=1;
}
}
The problem i have now is the following: I want to import only the rows until let's say the last row minus 10 rows. How can i find out how many rows my worksheet has? I only found out the worksheet-commands like:
WorksheetPage wp;
wp.Create("Origin");
Worksheet wks(wp.Layers(0));
int nRows = wks.GetNumRows();
But when i simply use the impASC-command, i don't have a worksheet-object to work on. Can i internally cast the imported data to a worksheet-object, so to use the GetNumRows()-command on it?
________________
I hope i explained my Problem in an understandable manner. Thank you for your help in advance.