Re: ファイルをバッチ処理してデータを集計テーブルに抽出するループを開始する前に、ファイル名と領域の列を含む新しいテーブルを作成し、必要に応じてフォーマットします。 最も簡単な方法は、新しいテーブルを作成してから、テーブル スクリプトのコピーを使用することです。 また、そのテーブルに参照変数を割り当てることを忘れないでください!

面積を計算した後のループでは、<< 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});
//);
Re: ファイルをバッチ処理してデータを集計テーブルに抽出する新しいデータ テーブルを作成し、ファイル名と領域を新しいテーブルに書き込むコードを追加しました。
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;
);Re: ファイルをバッチ処理してデータを集計テーブルに抽出するありがとう! 丁寧な説明も丁寧にしてくださいました。 従うのは簡単です:)
Re: ファイルをバッチ処理して集計表にデータを抽出するありがとう! 先に他の回答を拝見しましたが、こちらの回答も気に入っています。
データを集計表に抽出するためのファイルのバッチ処理分析を実行したいファイルが複数あります。 ファイルを開いて解析を実行し、この例では「曲線下の面積」の値を計算して、ファイル名と面積を含む集計表を作成するループを作成したいと考えています。 フォルダーからファイルを開いて分析を実行できます。 集計表の作成方法がわかりません。 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 );
);
私が希望する最終テーブルの例:

ご協力いただければ幸いです。 ありがとう
マスカスタマイゼーション