重新編碼腳本在使用 post query scipt 從 sql 服務器中提取數據後,我嘗試重新編碼數據(0 到 .)。 我的腳本末尾出現錯誤。 我可以在數據表本身上運行腳本,但希望在輸入數據時自動發生。
這是我的腳本。
將屬性添加到表(
{新腳本(
“重新編碼” ,
當前數據表() <<開始數據更新;
對於每一行(:純度_2 =匹配(:純度_2, 0 , 。 , 。 , 。 , :purity_2 ) );
對於每一行(:純度_3 =匹配(:純度_3, 0 , 。 , 。 , 。 , :purity_3 ) );
對於每一行(:純度_4 =匹配(:純度_4, 0 , 。 , 。 , 。 , :purity_4 ) );
對於每一行(:plus50_2 =匹配(:plus50_2, 0 , 。 , 。 , 。 , :plus50_2 ) );
對於每一行(:plus100_2 =匹配(:plus100_2, 0 , 。 , 。 , 。 , :plus100_2 ) );
對於每一行(:plus140_2 =匹配(:plus140_2, 0 , 。 , 。 , 。 , :plus140_2 ) );
當前數據表() <<結束數據更新
}
這是錯誤消息:
輸入意外結束。 也許缺少“,”或“)”。
嘗試解析函數“將屬性添加到表”的參數。
第 60 行第 45 列:當前數據表() << 數據更新結束;)}►
謝謝,
回复:重新編碼腳本編輯:忽略這一點,它與上面吉姆的帖子相同。
您還可以將新腳本消息直接發送到表:
dt << New Script(
"Recode 2",
Current Data Table() << Begin Data Update;
For Each Row( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
For Each Row( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
For Each Row( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
For Each Row( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
For Each Row( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
For Each Row( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
Current Data Table() << End Data Update;
);
回复:重新編碼腳本您需要將其作為消息發送到您的數據表。這是一種方法:
dt = current data table();
dt << Add Properties to Table(
{New Script(
"Recode",
Current Data Table() << Begin Data Update;
For Each Row( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
For Each Row( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
For Each Row( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
For Each Row( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
For Each Row( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
For Each Row( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
Current Data Table() << End Data Update;
)});
回复:重新編碼腳本我在使用“將屬性添加到表()”方面並沒有真正的經驗,但是在閱讀腳本索引中的定義時,您想要做的事情似乎不起作用。您的腳本的以下簡化將起作用
Names Default to Here( 1 );
Current Data Table() << New Script(
"Recode",
Current Data Table() << Begin Data Update;
For Each Row( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
For Each Row( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
For Each Row( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
For Each Row( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
For Each Row( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
For Each Row( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
Current Data Table() << End Data Update;
);
回复:重新編碼腳本這不起作用,我收到以下消息。
將屬性添加到表(
{新腳本(
“重新編碼”,
當前數據表() << 開始數據更新;
對於每一行( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
對於每一行( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
對於每一行( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
對於每一行( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
對於每一行( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
對於每一行( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
當前數據表() << 數據更新結束;
)}
) /*###*/;
回复:重新編碼腳本你最後缺少一個右括號。
Current Data Table() << End Data Update;)}<STRONG>);</STRONG>