将 JSL 脚本应用到 Excel 中的多个工作表所以我有一个包含多个工作表的 Excel 文件,每个工作表中都有相同类型的数据框(只是不同的值)。 我能够导出“Fit Y by X”的脚本
Open();
Fit Group(
Bivariate( Y( :Total_Cost ), X( :LGP1 ), Automatic Recalc( 1 ) ),
Bivariate( Y( :Total_Cost ), X( :iteration ), Automatic Recalc( 1 ) ),
Bivariate( Y( :LGP2 ), X( :LGP1 ), Automatic Recalc( 1 ) ),
Bivariate( Y( :LGP2 ), X( :iteration ), Automatic Recalc( 1 ) ),
<<{Arrange in Rows( 2 )}
)我正在使用此脚本使用 subprocess.call([, ]) 从 python 进行调用。
当我执行 python 代码时,我选择 excel 文件,并且脚本仅应用于第一个工作表,而我希望它应用于所有工作表。 有人可以帮助我如何实现这一目标吗?
我使用 JMP14 和 python3 来执行上述操作。
自动化和脚本编写回复:将 JSL 脚本应用于 Excel 中的多个工作表如果
Open();
打开所有工作表,那么下面的工作表应该可以满足您的要求。
names default to here( 1 );
Open();
For( i = 1, i <= N Table(), i++,
Data Table( i ) << Fit Group(
Bivariate( Y( :Total_Cost ), X( :LGP1 ), Automatic Recalc( 1 ) ),
Bivariate( Y( :Total_Cost ), X( :iteration ), Automatic Recalc( 1 ) ),
Bivariate( Y( :LGP2 ), X( :LGP1 ), Automatic Recalc( 1 ) ),
Bivariate( Y( :LGP2 ), X( :iteration ), Automatic Recalc( 1 ) ),
<<{Arrange in Rows( 2 )}
)
);