如何在 JSL 中删除给定条件的行你好。我是一名 JSL 新手,但有一些 VBA 和 Python 脚本编写经验。
我有一个表,其中有两列“purification_run”和“parent_purification_runs”。我想删除具有任何“parent_purification_runs”字段中包含的“purification_run”字段的每一行。我编写了以下 JSL 脚本来完成此操作,它运行,但没有执行预期的删除。有人可以帮助我走上正轨吗?谢谢!
// Get handles to the columns
purificationRunCol = Column("purification_run");
parentPurificationRunsCol = Column("parent_purification_runs");
// Get the list of all unique parent_purification_runs values
allParentPurificationRuns = parentPurificationRunsCol << Get Values;
// Iterate through each row
For Each Row(
// Get the purification_run value for the current row
currentPurificationRun = purificationRunCol << Get As String;
// Check if the purification_run is present in the list of parent_purification_runs
If(Contains(allParentPurificationRuns, currentPurificationRun),
// Delete the row if the condition is true
Current Data Table() << Delete Rows;
);
);自动化和脚本编写苹果系统回复:如何在 JSL 中删除给定条件的行这是解决问题的一种方法
Names Default To Here( 1 );
dt = Current Data Table();
// Get the list of all parent_purification_runs values
allParentPurificationRuns = :parent_purification_runs << get values;
For Each Row(
If( Contains( allParentPurificationRuns, :purification_run ),
dt << Select Rows( Row() )
)
);
Try( dt << delete rows );