0
我有一個逐行填充的二維數組。我有約200個參賽作品。這是可變的,但重複也被填充。如何從VBS中的二維陣列中刪除重複項
我該如何刪除這些重複項?或者甚至檢查數組中是否已經存在條目並跳過該重複條目?
for each oSingleNode in oNodeList
if oSingleNode.xml <> "" Then
Set oNode = oSingleNode.selectSingleNode("j.8:entity-reference")
if not oNode is nothing then
s = oNode.getAttribute("rdf:resource")
a = Split(s, "/")
attribute = a(ubound (a)-1)
Set oNodeTwo = oSingleNode.selectSingleNode("j.8:entity-label")
if not oNodeTwo is nothing then
label = oNodeTwo.text
array(rowIndex,index) = attribute
array(rowIndex,constClm)= label
debug2File array(rowIndex,index) & " " & array (rowIndex, constClm)
End if
End if
End If
用於在VBScript唯一性的工具是字典插入(參見http://stackoverflow.com/a/6592801/603855) 。對於你的問題的具體解決方案,你應該定義/例證唯一/重複,並決定是否要清理'髒'數組或建立一個乾淨的。 –
在您的方案中哪些被認爲是重複的?單個字段或整行? –
我有解決方案,但不是在VB腳本。 – Suji