循环中的变量你好,
我喜欢替换值
列名开始( 2个),
数据开始( 3个));
作为列名称开始 (HeadStart) 中的 Headstart=2、DataStart=3 之类的变量。 我用了
评估(解析(“列名开始(“||HeadStart||” )," ));
我没有收到任何错误,但结果不正确。
我感谢您的帮助。 谢谢
---------------------------------------------- --------------
为了( 三 = 1个, iii <= nf, iii++, //这开始第一个循环
filenow = (文件列表[iii]);
dt =打开( filenow, 私人,
列名开始( 2个),
数据开始( 3个));
新建专栏( “来源” , 字符, 标称 );
:来源<<设置每个值(现在文件);
//dt<
dt <<运行公式();
//将当前表添加到组合数据表的底部
表 <<串联(数据表( dt ), 追加到第一个表 );
//不要使用“创建源列”参数
关闭(dt,不保存); //连接表后,关闭它并继续
); //第一个for循环结束
Re: 循环中的变量嗯……原来如此。 这对我有用:
n=2; // b
d=4; // d
open(chartoblob(
"a
b
c
d"),columnnamesstart(n),datastarts(d))
我认为不需要替换。 很高兴吉姆让你走了!
Re: 循环中的变量非常感谢吉姆。 它现在完美运行。
Re: 循环中的变量我会将 open into 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
)
);Re: 循环中的变量谢谢。 确实可以在 JMP 首选项中定义列数据和名称开始。 但是我已经在 open() 里面试过了,它工作正常。 我只需要在 open() 中对其进行参数化。
Re: 循环中的变量这些选项位于导入设置中。
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" )
)
)