早上好
我需要一個腳本來提取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和文件。
我需要在初步和重複性數據下做一個平均值。然後用這個平均值比較後應力,但是在列中。
非常感謝你,
安東尼
如果您可以顯示輸入文件夾和文件夾中的文件樣本將非常有用。