VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Compare two text files with the differences being written to a new file. Just paste this sub somewh

by Karl Durrance (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 7th October 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Compare two text files with the differences being written to a new file. Just paste this sub somewhere in your form, then call like this

Rate Compare two text files with the differences being written to a new file. Just paste this sub somewh



Open Fileone For Input As #1
Fileonelen = LOF(1)
FileoneRead = Input(Fileonelen, #1)
Close #1
Open Filetwo For Input As #2
Open Output For Output As #3
Do While Not EOF(2)
    Line Input #2, CurrentLine
    Current.Value = Current.Value + Len(CurrentLine)
    If InStr(1, UCase(FileoneRead), UCase(CurrentLine)) Then
        'do nothing no differences in file
    Else
        'difference found, write it to the output file
        Print #3, CurrentLine
                        
    End If
Loop

Close #2
Close #3
   
End Sub

Download this snippet    Add to My Saved Code

Compare two text files with the differences being written to a new file. Just paste this sub somewh Comments

No comments have been posted about Compare two text files with the differences being written to a new file. Just paste this sub somewh. Why not be the first to post a comment about Compare two text files with the differences being written to a new file. Just paste this sub somewh.

Post your comment

Subject:
Message:
0/1000 characters