你好,
基本上我想做的是有一个脚本,它将在多个文件夹上运行“多文件导入”并将结果连接到一个表中。这是我当前的脚本:
path = ""; // (actual folder path redacted, pretend something that works is here)
fid = Files In Directory(path);
// Remove all the files, just leaving the folders
for(f=NItems(fid), f>=1, f--, if(IsFile(path||"/"||fid[f]), RemoveFrom(fid, f)));
vn = 0;
print(N Items( fid ));
For( LV1 = 1, LV1 <= N Items( fid ), LV1++,
print(LV1);
If(
contains(fid[LV1],"EU")
,
vn++;
VAReus = contains(fid[LV1],"EU");
STRrn = substr(fid[LV1],VAReus,9);
show(fid[LV1],STRrn);
STRfold = path||char(fid[LV1]);
DT1 = Multiple File Import(
<<SET folder=""></SET>
By the time it gets to the stop command i've hit several problems:
1. none of the close data table commands have worked
2. the <CODE class=" language-jsl">DTT1:Label[1]change has changed the label column in the DTM table for some reason
3. when running certain parts of the script after, eg highlighting DTT1 and DTM, the log seems to think these are the right data tables
4. trying to run the close command without try() gived the error: invalid argument in access or evaluation of 'Close' , Close/*###*/(DT1, nosave)
如果没有可用于读取一堆文件的文件结构,则很难进行调试。当我需要做类似的事情时,我通常使用的方法是使用 File in Directory() 函数上的递归选项,然后一次读入一个文件,将该文件连接到主文件,然后然后继续处理下一个文件。