script after file import not executinghi, 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>ScriptingRe: script after file import not executingProbably more than one table open, try being explicit, like this
If( (Col N Missing( Column(dt, j ) ) / N Row()) == 1
I think the column function is using a different table (actually, the current table) than the one you expect. Adding the dt to the column function tells it which table, otherwise it is the current table (which may not have caught up when you run it in one go.)
Re: script after file import not executingCraige
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>
</CODE></PRE><P> </P></LINGO-BODY><LINGO-SUB id="lingo-sub-390303" slang="en-US" mode="NONE">Re: script after file import not executing</LINGO-SUB><LINGO-BODY id="lingo-body-390303" slang="en-US" mode="NONE"><P>After</P><PRE><CODE class=" language-jsl">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.
edit: don't use current data table() if you can avoid it. Use an explicit handle like dt[1] if possible. Current Data Table is a JSL function that tries to behave like JMP, before JSL was invented, where the last table touched would be the table used by the next platform.