早上好
我需要一个脚本来提取forder中的.txt数据,并使用另一个文件夹中的数据进行平均。但是数据必须保留在列中。我可以告诉你一个测试文件夹。
你能帮助我吗 ?(对不起我的英语不好)
最好的祝福,
安东尼
这是你想要的好开始。 如果它不是您想要的,它应该给您足够的示例,以便您进行所需的修改。
Names Default To Here( 1 );
Clear Symbols();
// Add in the all of the folders that need to have data tables read in from
prefilepathList = {
"C:\Users\txjim\Documents\average issue\BEAVD\REPEATABILITY\",
"C:\Users\txjim\Documents\average issue\BEAVD\PRELIMINARY\"
};
cctable = New Table( "Combined data table " );//make an empty table
cctable << New Column( "Source", Character, Nominal );
For( path = 1, path <= N Items( prefilepathList ), path++,
filepath = prefilepathList[path];
prefilelist = Files In Directory( filepath );
n2 = N Items( prefilelist );
filelist = {};
//filter out any non-txt or csv files
For( i2 = 1, n2 >= i2, i2++,
file = (prefilelist[i2]);
If(
Item( 2, prefilelist[i2], "." ) == "txt" | Item( 2, prefilelist[i2], "." ) == "csv" |
Item( 2, prefilelist[i2], "." ) == "dat",
Insert Into( filelist, file ),
Show( file )
);
);
nf = N Items( filelist ); //number of items in the working list
For( iii = 1, iii <= nf, iii++, //this starts the first loop
filenow = (filelist[iii]);
fileopen = (filepath || filenow);
dt = Open(
fileopen,
Import Settings(
End Of Line( CRLF, CR, LF ),
End Of Field( Tab, Other( ";" ), CSV( 0 ) ), //use ";" as a delimiter too
Strip Quotes( 1 ),
Use Apostrophe as Quotation Mark( 0 ),
Scan Whole File( 1 ),
Treat empty columns as numeric( 0 ),
CompressNumericColumns( 0 ),
CompressCharacterColumns( 0 ),
CompressAllowListCheck( 0 ),
Labels( 1 ),
Column Names Start( 61 ), //starting on second row
Data Starts( 62 ), //data starts on 3rd row
Lines To Read( "All" ),
Year Rule( "20xx" )
),
invisible
);//Import settings used in the open argument
New Column( "Source", Character, Nominal );
:Source << set each value( filenow );
dt << Run Formulas();
//add the current table to the bottom of the combined data table
cctable << Concatenate( Data Table( dt ), Append to first table );
Close( dt, NoSave );//after concatenating the table, close it and move on
);//end of the first for loop
);
// Calculate the output
Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table( Analysis Columns( :MEAN_VBIAS_MEAS ), Statistics( Mean ) ),
Column Table( Analysis Columns( :MEAN_VOUT_MEAS ), Statistics( Mean ) ),
Column Table( Analysis Columns( :MEAN_BRIDGE_RATIO ), Statistics( Mean ) ),
Row Table( Grouping Columns( :BRIDGE_NUMBER, :SAMPLE_ID ) )
)
)
对不起,我没有好好解释,
我需要一个脚本来提取子文件夹中的所有文件,并在jmp数据表中将其连接起来,如脚本附件“Script_Base”。
在我需要创建新的“AVERAGE_VBIAS”之后,计算“MEAN_VBIAS_MEAS”初步和可重复性下的平均值:
例:
初步和可重复性下的avarage “” MEAN_VBIAS_MEAS''by“BRIDGE_NUMBER”by“SAMPLE_ID”
还有列“MEAN_VOUT_MEAS”和“MEAN_BRIDGE_RATIO”。
最好的祝福,
安东尼
您附加的文件夹结构中的数据文件可以很容易地读取。 唯一的复杂性是找到数据开始的行号(61),以及用于分隔不同数据字段的分隔符。(Tab)。
要读入数据,请转到
文件==>打开
然后导航到数据所在的文件夹,然后单击要打开的文件。 只需单击一次,它就会显示一些其他选项

如上所示,选择“带预览的数据”
然后单击“打开”。
然后,您将看到以下屏幕

更改屏幕以匹配上述设置,然后单击“下一步”按钮。
在显示的下一个屏幕上,您可以预览将要输入的数据。 准备好后单击“导入”按钮,将打开并显示数据表。
重复相同的过程以导入第二个数据表。
为了完成显示平均值的请求,我建议你使用
Cols ==>列查看器
你似乎对JMP很新。 我强烈建议您阅读JMP提供的文档
帮助==>书籍==>发现JMP,使用JMP,基本分析
这是forlder和文件。
我需要在初步和重复性数据下做一个平均值。然后用这个平均值比较后应力,但是在列中。
非常感谢你,
安东尼
如果您可以显示输入文件夹和文件夹中的文件样本将非常有用。