Hi,
You could try to use findfiles X-Function:
https://www.originlab.com/doc/X-Function/ref/findFiles
I wrote a simple example:
strPath$ = System.path.program$ + "Samples";
findfiles path:=strPath$ ext:="txt" recursive:=1 fname:=results$;
int nn = results.GetNumTokens(CRLF);
int nFlag = strPath.GetNumTokens("\");
for(int ii = 1; ii <= nn; ii++)
{
strFile$ = results.GetToken(ii,CRLF)$; //Get Import File
strFile.GetToken(nFlag+1, "\")$=; //Get the name of subfolder under the strpath$
}
Hope it helps.
Regards,
Yuki
OriginLab