Hi,
I am writing script to import several Excel files to JMP as follows:
directory = "C:\Documents\Projects\";
Set Default Directory(directory);
allfiles = Files In Directory( directory);
excelfiles = {}
For (i = 1, i<= NI tems(allfiles), i++,
if ( Ends With( allfiles[i], ".xlsx") ,
Insert Into (excelfiles, allfiles[i]);
);
);
The problem is allfiles returns { "~$file1.xlsx", "file1.xlsx", "~$file2.xlsx", "file2.xlsx", ...etc}, and I can't seem to get rid of "~$" in the file names. I can't see those files in Windows Explorer, not even when view hidden files is selected. I added !Starts With (allfiles[i], "~$") to the if() statement, it didn't remove those tmp files.
What's more confusing is:
length(excelfiles[1]) = 10
length(excelfiles[2]) = 12
but,
substr(excelfiles[1], 1, 3) = fil ....shouldn't this be "~$f" ??
I would really appreciate if anyone can shed some light on this. Thanks!