| 发表于:2007-02-11 13:22:473楼 得分:0 |
试试这个行不行: dim col as new collection dim stemp as string dim arr() as string dim i as integer dim b as boolean b = false open app.path & "\t.txt " for input as #1 while not eof(1) line input #1, stemp if trim(stemp) <> vbnullstring then stemp = strconv(stemp, vbnarrow) for i = 1 to col.count if trim(split(col.item(i), ", ")(0)) = trim(split(stemp, ", ")(0)) then stemp = trim(split(stemp, ", ")(0)) & ", " _ & (val(split(col.item(i), ", ")(1)) + val(split(stemp, ", ")(1))) col.remove i col.add stemp b = true exit for end if next if b = false then col.add stemp end if b = false end if wend close #1 redim arr(col.count) for i = 1 to col.count arr(i) = col.item(i) debug.print arr(i) next | | |
|