回复:批处理文件以将数据提取到汇总表中在开始循环之前,使用文件名和区域列创建新表,并按照您希望的方式对其进行格式化。 最简单的方法是创建新表,然后使用复制表脚本。 还要记住将引用变量分配给该表!

然后在计算完面积后的循环中,您可以使用 << 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 );
);
我想要的决赛桌示例:

任何对此的帮助将不胜感激。 谢谢
大规模定制