循環中的變數你好,
我喜歡替換以下值
列名開始( 2 ),
數據開始( 3 ) );
作為變量,如列名 Start(HeadStart) 中的 Headstart=2、DataStart=3。 我用了
評估(解析(“列名稱 Start("||HeadStart||" ),” ));
我沒有收到錯誤,但結果不正確。
我感謝您的幫助。 謝謝
-------------------------------------------------- --------------
為了( 三 = 1 , iii <= nf, iii++, //這開始第一個循環
filenow = (文件列表[iii]);
dt =打開(文件現在,私人,
列名開始( 2 ),
數據開始( 3 ) );
新專欄( “來源” ,特性,標稱);
:來源<<設定每個值(立即歸檔);
//dt<<新欄位("來源", 字元, 標稱)<<設定每個值(9999);
dt <<運行公式();
//將目前表格新增到組合資料表的底部
cc表<<連接(數據表( dt ), 附加到第一個表);
//不要使用「建立來源列」參數
關閉(dt, 不保存); //連接表格後,關閉它並繼續
); //第一個for迴圈結束
回覆:循環中的變數嗯……原來如此。 這對我有用:
n=2; // b
d=4; // d
open(chartoblob(
"a
b
c
d"),columnnamesstart(n),datastarts(d))
我不認為為此需要替換。 很高興吉姆讓你繼續前進!
回覆:循環中的變數非常感謝吉姆。 現在效果很好。
回覆:循環中的變數我會將 open 放入 Substitution() 結構中進行更改並運行程式碼
datastart = 2;
namestart = 1;
Eval(
Substitute(
Expr(
Open(
"C:\...\simple.txt",
columns(
New Column( "1", Numeric, "Continuous", Format( "Best", 12 ) ),
New Column( "2", Numeric, "Continuous", Format( "Best", 12 ) )
),
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( __namestart__ ), // <<<<<<<<<<<<<<
Data Starts( __datastart__ ), // <<<<<<<<<<<<<<<<
Lines To Read( "All" ),
Year Rule( "20xx" )
)
)
),
Expr( __namestart__ ), namestart,
Expr( __datastart__ ), datastart
)
);回覆:循環中的變數謝謝。 確實,可以在 JMP 首選項中定義列資料和名稱開始。 但我在 open() 內部嘗試過,效果很好。 我只需要在 open() 中對其進行參數化。
回覆:循環中的變數這些選項位於導入設定內。
Open(
"C:\...\simple.txt",
columns(
New Column( "1", Numeric, "Continuous", Format( "Best", 12 ) ),
New Column( "2", Numeric, "Continuous", Format( "Best", 12 ) )
),
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( 1 ), // <<<<<<<<<<<<<<
Data Starts( 2 ), // <<<<<<<<<<<<<<<<
Lines To Read( "All" ),
Year Rule( "20xx" )
)
)