Set fs = CreateObject("Scripting.FileSystemObject")
if get_SubType ="octet-stream" then
Set fp = fs.openTextFile(server.mappath("cht.txt") ,1,1,-2)
else
Set fp = fs.openTextFile(server.mappath("cht.txt"))
end if
Do while fp.AtEndOfStream <> TRUE
total = total + 1
TextLine =trim(fp.ReadLine)& ","
ALL_TextLine=ALL_TextLine & TextLine
LOOP
set fp=nothing
Set fp = fs.openTextFile(server.mappath("cht2.txt")) ' 資料多的檔案
Do while fp.AtEndOfStream <> TRUE
total2 = total2 + 1
TextLine2 =trim(fp.ReadLine)& ","
ALL_TextLine2=ALL_TextLine2 & TextLine2
LOOP
set fp=nothing
ary_text = Split(ALL_TextLine2,",")
redim ary_diff(200)
for i=0 to total2 -1
if instr (ALL_TextLine,ary_text(i)) > 0 then
samecnt=samecnt+1
response.write "<br>" & ary_text(i) &"此筆相同"
else
diffcnt=diffcnt+1
response.write "<br><font color=red>" & ary_text(i) &"此筆相異</font>"
ary_diff(diffcnt)=ary_text(i)
end if
next
response.write "<br>相同:" & samecnt
response.write "<br>相異:" & diffcnt
'以下為相異
for j=1 to diffcnt
response.write "<br>" & ary_diff(j)
next
留言列表