hi, I am importing bunch of files from a directory and stacked them into one big file(45 files), after import into one big file, the script will clean up the dataset, add columns and rows etc. the problem I encountered is that the script will error out if being executed together as a whole piece; if I run the import first, wait for the files to load into jmp, and then run the 2nd portion of the code, it will work. I had wait(150) in between which is more than enough time to import the data, but it still does not work. the error message says " invalid argument in access or evaluation of "Column" Column/*###/(j). I did notice the script immediate after import for PVOTC update is not executed neither. Below is my code, your help is greatly appreciated.
files = Files In Directory( loadPath);
For( i = 1, i <= N Items( files ), i++, //previous steps non drb or already parsed)
subLoadPath = loadPath ||files[i];
stepID = num(word(2,word(-1,subLoadPath,"/" ),"_"));
If( Is directory(subLoadPath) & stepID >= 11, // 11 is the step started to parse
tableName = word(-1,subLoadPath,"/" );
tableName_flow = word(-2,subLoadPath,"/" );
dt = Multiple File Import(
<<SET folder="">= 1, j--,
If( (Col N Missing( Column( j ) ) / N Row()) == 1,
dt << delete columns( j )
)
);
Wait(5);
dt << Clear Column Selection(); </SET>After
dt = Multiple File Import(...) << Import Data;
dt holds a list of data tables, even if only one table is imported.
You don't need the wait(150).
dt[1] will be the current data table if only one table was imported.
Craige
Thanks for your reply, now I made the change but the code still can't be executed as whole, PVOTC missing value is not updated, also see the same error message "invalid argument in access or evaluation of 'Column' , Column/*###*/(j)"
</CODE><CODE class=" language-jsl">dtImpt = Multiple File Import(
<<SET folder="">= 1, j--,
If( (Col N Missing( Column( j ) ) / N Row()) == 1,
dt << delete columns( j )
)
);
dt << Clear Column Selection(); </SET>