回复:批處理文件以將數據提取到匯總表中在開始循環之前,使用文件名和區域列創建新表,並按照您希望的方式對其進行格式化。 最簡單的方法是創建新表,然後使用複製表腳本。 還要記住將引用變量分配給該表!

然後在計算完面積後的循環中,您可以使用 << Get Name 獲取表名稱,然後使用 << Add Rows() 將新行添加到您的集合表中。 還記得在獲得相關信息後關閉不必要的表格和報告。
Names Default To Here(1);
dt_collector = New Table("Untitled",
Add Rows(0),
New Column("File Name", Character, Nominal, Set Values({})),
New Column("Area", Numeric, "Continuous", Set Values([]))
);
// For(..
// ...
//dt_name = dt << Get Name;
dt_name = "table";
area = 123;
dt_collector << Add Row({File Name = dt_name, Area = area});
//);
回复:批處理文件以將數據提取到匯總表中我添加了創建新數據表的代碼,並將文件名和區域寫入新表
Names Default to Here( 1 );
//point to file directory
path = Pick Directory( "Select Directory Containing Data Files" );
//Gets the list of files in the selected file folder
file_list = Files In Directory( path );
// Crete beginnings of output data table
dtFinal = New Table( "Final", New Column( "File Name", Character ), New Column( "Area" ) );
//i=0;open file
nfile_list = N Items( file_list );
For( i = 1, i <= nfile_list, i += 1,
//Set Current Directory( dir_DirectoryPath );
dt = Open( path || file_list[i], );
//Calculate area
dt = Current Data Table();
dt << clear row states;
obj3 = dt << Bivariate(
invisible,
Y( :Name( "Data" ) ),
X( :Time ),
Fit Polynomial( 6, {Line Color( {212, 73, 88} )} ),
SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 449, 411 )} ) )
);
//save graph to data dable
obj3 << Save Script to Data Table( "Area" );
//get the prediction formula string and calculate the area under the curve for 30 minute adsoription
fm = Report( obj3 )[Outline Box( "Polynomial ?" )][Text Edit Box( 1 )] << get text;
//get the string to the right of the equal sign and convert the string to an expression using Parse()
fm = Parse( Trim( Word( 2, fm, "=" ) ) );
area = Integrate( fm, :Time, 0, 3600 );
Caption( "The area under this curve is " || Char( area ) );
Print( area );
// Add information to Final data table
dtFinal << add rows( 1 );
dtFinal:File Name[N Rows( dtFinal )] = file_list[i];
dtFinal:area[N Rows( dtFinal )] = area;
);回复:批處理文件以將數據提取到匯總表中謝謝你! 你也給出了很好的詳細解釋。 易於遵循:)
回复:批處理文件以將數據提取到匯總表中謝謝你! 我先看到了另一個回复,但我也喜歡這個。
批處理文件以將數據提取到匯總表中我有多個文件想要對其進行一些分析。 我想創建一個循環來打開文件,執行分析,計算本示例中的“曲線下面積”值,然後使用文件名和麵積製作一個匯總表。 我可以從文件夾中打開文件並執行分析。 我不確定如何創建匯總表。 我給出了一個包含 2 個文件的示例,但我還有更多文件想要以這種方式處理。 非常感謝任何幫助或指導! 另外,如果這沒有意義或需要更多信息,請告訴我。
//point to file directory
path = Pick Directory( "Select Directory Containing Data Files" );
//Gets the list of files in the selected file folder
file_list = Files In Directory( path );
//i=0;open file
nfile_list = N Items( file_list );
For( i = 1, i <= nfile_list, i += 1,
//Set Current Directory( dir_DirectoryPath );
dt = Open( path || file_list[i], );
//Calculate area
dt = Current Data Table();
dt << clear row states;
obj3 = dt << Bivariate(
Y( :Name( "Data" ) ),
X( :Time ),
Fit Polynomial( 6, {Line Color( {212, 73, 88} )} ),
SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 449, 411 )} ) )
);
//save graph to data dable
obj3 << Save Script to Data Table( "Area" );
//get the prediction formula string and calculate the area under the curve for 30 minute adsoription
fm = Report( obj3 )[Outline Box( "Polynomial ?" )][Text Edit Box( 1 )] << get text;
//get the string to the right of the equal sign and convert the string to an expression using Parse()
fm = Parse( Trim( Word( 2, fm, "=" ) ) );
area = Integrate( fm, :Time, 0, 3600 );
Caption( "The area under this curve is " || Char( area ) );
Print( area );
);
我想要的決賽桌示例:

任何對此的幫助將不勝感激。 謝謝
大規模定制