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