大家好,
我嘗試在名為 Sample_ID 的列中找到以 452 結尾的特定字符串,並創建一個子集,其中包含具有該字符串的所有行以及所有其他列。 我嘗試編寫如下代碼,但在日誌中出現“I/O 問題”和“無法以讀寫模式打開”。
那麼這裡的問題是什麼?
有人可以幫我解決這個問題嗎?
謝謝
Names Default to Here(1);
Clear Log();
Clear Symbols();
Close All( Data Tables, NoSave );
Close All(Journals, NoSave );
// pick data table 1
dt1_dir = Pick Directory( "Select directory for data table 1");
dt1_Name = Pick File(
"Select data file 1",
dt1_dir,
{"JMP Files|jmp;jsl;jrn", "All Files|*"},
1,
0,
0
);
Show(dt1_Name); // show dt1_Name string in log
dt1=Open(dt1_Name); // reassign dt1 to data table from string dt1_Name
Show(dt1); // show data table dt1 in log to check
// pick data table 2
dt2_dir = Pick Directory( "Select directory for data table 2");
dt2_Name = Pick File(
"Select data file 2",
dt2_dir,
{"JMP Files|jmp;jsl;jrn", "All Files|*"},
1,
0,
0
);
Show(dt2_Name);
dt2=Open(dt2_Name);
Show(dt2);
//concatenate two tables and concat_dt is the output table
concat_dt = dt1 << Concatenate(dt2,
Output Table("concat data table"),
Create Source Column
);
Show(concat_dt); //show concat_dt data table in log
Close(dt1, NoSave);
Close(dt2, NoSave); //close both dt1 and dt2
//select specific sample_ID from concat_dt and make subset out of it
prep_dt = concat_dt << Subset(Row(
concat_dt << get rows where(Regex( :Sample_ID, "71MT052800452") == :Sample_ID)),
selected columns only(0),
);
Close(concat_dt); // close concat_dt