自動導入文件我已經使用工作流程匯入了一個 Excel 文件,並正在編輯腳本以使其更加通用。在“列名稱開始”下的導入設定中,是一個特定的數字,但我希望它是在滿足特定條件時(例如,當第 5 行第 2 列顯示“開始”,開始是列名稱時)。
非常感謝任何正確方向的幫助。
程式碼片段如下,重要功能以粗體顯示:
Import Settings(
End Of Line( CRLF, CR, LF ),
End Of Field( Comma, CSV( 0 ) ),
Strip Quotes( 1 ),
Use Apostrophe as Quotation Mark( 0 ),
Use Regional Settings( 0 ),
Scan Whole File( 1 ),
Treat empty columns as numeric( 0 ),
CompressNumericColumns( 0 ),
CompressCharacterColumns( 0 ),
CompressAllowListCheck( 0 ),
Labels( 1 ),
Column Names Start( 263 ),
First Named Column( 1 ),
Data Starts( 264 ),
Lines To Read( "All" ),
Year Rule( "20xx" )
)
自動化和腳本編寫內容組織資料混合與清理數據探索和視覺化回覆:自動導入文件這是一些偽代碼,可能會幫助您了解可能使用的方法
dt = Open(<EXCEL file="">);
// Get the first row where the second column has the word START
headerRow = dt << get rows where( contains( as column(2), "START" )[1];
dataRow = headerRow + 1;
// Close the data table
close(dt, nosave);
// Substitute into the full Excel Import Settings the the header row number and
// the data row number and run the code
Eval(
Substitute(
Expr(
dt = Open(.........
Column Names Start( _H_ ),
First Named Column( 1 ),
Data Starts( _S_ ),
......................);
),
expr( _H_ ), headerRow,
expr( _S_ ), dataRow
)
);</EXCEL>
回覆:自動導入文件匯入整個檔案並在匯入後在 JMP 中執行資料清理可能會更容易(當然取決於您的資料)。