close

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

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 11 的頭像
    11

    冠霖的部落格

    11 發表在 痞客邦 留言(0) 人氣()