| |
|
|
| Text File comparison procedure - Have I sometime time used ^^ procedure position only solid whether The Textfiles exakt same are. it go no differences gefiltert.
{$iq}//xpse
cls
print "is exact same?: "+if(fle_compareexact ("org.txt","second.txt"),"Jo","Nö")
waitkey
end
proc fle_compareexact
parameters fle1$,fle2$
declare ex%,s$,ss$
assign #1,fle1$
assign #2,fle2$
reset #1
reset #2
ex%=0
whilenot ex%
input #1,s$
input #2,ss$
if (trim$(s$)<>trim$(ss$))
ex%:=2
elseif ( eof(#1) & eof(#2) )
ex%:=1
elseif eof(#1)
ex%:=2
elseif eof(#2)
ex%:=2
endif
case ( eof(#1) & eof(#2) ) : casenot ex% : ex%:=1
wend
close #1
close #2
return if(equ(ex%,1),1,0)
endproc
|
|
|
| |
|
|
|
Frank Abbing | Hi,
here my Variante, with the arbitrary Files on equality examined go can. and the very quick.
Files on equality Verify
(c) Frank Abbing
Set("ErrorLevel",0)
Declare Text$
Def CompareStrings(2) !"KERNEL32","lstrcmpi"
Cls
text$=SameDatas("Dateiname_1","Dateiname_2")
Print "Die both Files are "+text $+"."
WaitInput
End
two Files vergleichen
SameDatas para1, para2
para1 = name of File 1
Para2 = name of File 2
Proc SameDatas
Parameters gtext1$,gtext2$
Declare gx&,gx1&,gx2&,gbereich1#,gbereich2#
gx1&=FileSize(gtext1$)
gx2&=FileSize(gtext2$)
gx&=gx1&+gx2&
If ((gx&>0) and (gx1&=gx2&))
Dim gbereich1#,gx1&
Assign #1,gtext1$
OpenRW #1
@BlockRead(#1,gbereich1#,0,gx1&)
CloseRW #1
Dim gbereich2#,gx2&
Assign #1,gtext2$
OpenRW #1
@BlockRead(#1,gbereich2#,0,gx2&)
CloseRW #1
gx&=CompareStrings(gbereich1#,gbereich2#)
Dispose gbereich1#
Dispose gbereich2#
If (gx&=0)
Return "gleich"
Else
Return "ungleich"
EndIf
Return "gleich"
Else
Case (gx1&<>gx2&): Return "verschieden big and so ungleich"
Return "nicht present or defective. at least a davon"
EndIf
ENDPROC
|
|
|
| |
|
|
|
Rolf Koch | Hi Frank and by me functions your example not.
CROFANA.TXT and CROFANB.TXT laid out and same Content. Return is: No or defective. at least a of it
But everything present and Order.
Rolf |
|
|
| |
|
|
|
Frank Abbing | Hi,
then could the program a of it Perhaps not loading? Fehlt sure only one FileMode 0. could you the review with you? |
|
|
| |
|
|
|
Rolf Koch | Hello Frank, No both fully aale. before freshly laid out. means integrally normal Files. not read or so.
Rolf |
|
|
| |
|
|
|
| my Proc having a small logischen Error - with Dateiende wars alike whether The last both Lines übereinstimmten if both Files same-many Lines had.
Habs fixed.
@Frank: your Proc is less suitable TextFiles To vergleichen. Text files must not The same Size having circa same To his - too must tappt im dunkeln never byteexact-same his. How the name already says - the same Text must drinnstehen - even if on the right place.
naturally is ne while { input combination always ne SpeedKrücke - and naturally ließe the operation too as Speicheroperation manage. Bisl mempos on #10 etc.
salvo, iF |
|
|
| |
|
|
|
Frank Abbing | iF, space etc. belong likewise to that Text and its Formatierung. alike whether Textdatei or other, Übereinstimmung is by me exakte Übereinstimmung. but Please. Rolf, What is there go. you are the Programmierens still More as capable. find You the trouble not? I can nothing discover... |
|
|
| |
|
|
|
Rolf Koch | Well, i'm To More capable, the likes his. however work I in retail and it short to christmas ...... must I there yet plenty say. I Have z.Zt. by the Stress even Problems a fünfzeiler To write, without that I me dauernd verhaue no, but it's located really nothing ungewöhnliches to. both Text files whether equal to or abgeändert report whom Error. both Text files are straight freshly prepares been. both Text files are for read/Schreibzugriff fine suitable. unfortunately How already from supra named Found and because of Noc Update (so I finally again with empty Roc weg can - soon comes Yes P9 and there should Roc too correct his) come I do not moreover your Sourcecode detailgenau durchzugehen. but I wealth, that your code still correctly arranged is, or?
Rolf |
|
|
| |
|
|
|
| Frank I know the space to that Text belong. I Have still too never what other behauptet - you are soo miserable. I wrote Text files must not The same Size and have neither byte-exact.
the can to that Bleistift hot the a Textdatei too then whom equal Textinhalt has if these z.B. with others Steuerzeichen stored is.
z.B. only #10 instead of #13#10
but what erzähl I you - sure nothing New.
the Trim what supra standing is objectively less correctly.. hang of it ex for what one The Proc benefit would like - möge eachone self decide. there geb I you right - but meant You, the?
salvo, iF |
|
|
| |
|
|
|
Frank Abbing | @iF: clear, habs Yes understood . should the User still decide, what the right for it is, ne?
@Rolf: Schick me the two Files still simply time. naturally only, if You want... shining so, as would FileSize not correctly. works...
P.s. is christmas not the solid the silence and relaxation? :biggrin: |
|
|
| |
|
|
|
| [quote:db58989a3e=Frank Abbing]@iF: clear, habs Yes understood . should the User still decide, what the right for it is, ne? [/quote:db58989a3e]Nain grrrr the Programmer.
[quote:db58989a3e]@Rolf: Schick me the two Files still simply time. naturally only, if You want... shining so, as would FileSize not correctly. works...
P.s. is christmas not the solid the silence and relaxation? :biggrin:[/quote:db58989a3e]I know not the we here what other do.
salvo, iF
|
|
|
| |
|
|
|
Jörg Sellmeyer | Hi, so How I that see, get the program quite no chance mismatched Files testing there If ((gx&>0) and (gx1&=gx2&)) mismatched Files already ausschließt and same to Error Message verzweigt. with Or ought to it functions. Greeting Jörg |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 12/01/04 ▲ |
|
|
|