我在論壇中找到了一種方法,可以將表格連接在一起。 我嘗試過使用現有表的列表,其中起始表屬於同一類型。 有人發現我的錯嗎?
Names Default To Here( 1 ); Clear Log(); Clear Symbols(); Close All(Data Tables, No Save); Close All(Journals, No Save); Close All(Reports,No Save);
Path = "C:\Users\u387536\Documents\01 Data and Analysis\08 IP21 to JMP Data Integraton\Working Folder Data Read-In\Data\";
filelist = {};
filelist[1] = Open(Path||"file 1.jmp",private);
filelist[2] = Open(Path||"file 2.jmp",private);
filelist[3] = Open(Path||"file 3.jmp",private);
filefinal = "file 123.jmp";
nf=nitems(filelist); //number of items in the working list
cctable= New Table( "Combined data table ");//make an empty table
cctable << New Column( "Source", Character, Nominal );
For( iii = 2 , iii <= nf, iii++, //this starts the first loop
filenow = ( filelist[iii] );
fileopen=(filepath||filenow);
//dt=open(fileopen,private);
//dt=open(fileopen,importset,private);//Import settings used in the open argument
dt = filelist[1];
New Column( "Source", Character, Nominal );
:Source << set each value( filenow );
//dt<<NEW column=""></NEW>
檢查並查看“filenow”的值。 我假設您相信它只有數據表的值。 但你會看到它的價值是:
數據表(“文件名”)
如果你想要的只是“文件名”,你需要請求從“filenow”返回它
filenow << 獲取名稱
我強烈建議您閱讀腳本指南
幫助==>書籍==>腳本指南
它將展示如何查看變量值,方法是將光標放在變量上,或者使用 show() 函數查看變量值,或者使用 JSL 調試器,這樣您就可以單步執行代碼並準確查看變量值。代碼正在做。
日誌中彈出的錯誤是:
在訪問或評估“設置每個值”時,列 Source{1} 的表達式的結果類型錯誤,設置每個值( filenow ) /*###*/
請問您在日誌中看到什麼錯誤(“Windows > 日誌”)? 看起來“文件路徑”未分配。