zvd Posted April 15, 2005 Share Posted April 15, 2005 (edited) What is the best way (if possible) to compare the contents of 2 text files, and output the difference? I'd like to do in AutoIT what the Unix command diff does so easily. Edited April 15, 2005 by zvd Link to comment Share on other sites More sharing options...
buzz44 Posted April 15, 2005 Share Posted April 15, 2005 Via what means are you comparing them? and what do the text files contain, Information line by line? etc. qq Link to comment Share on other sites More sharing options...
Ejoc Posted April 15, 2005 Share Posted April 15, 2005 (edited) This would be challenging, there are windows versions of diff/grep...etc MinGW has some, as does DJGPP I'll attach diff at the end of this post diff is really useful for making patches for text files. Imagine you have an AutoIt version 1.1 thats 100,000 lines long whoa! You fix a bug and now its version 1.2, instead of making me d/l the whole script over again, you can run diff between the 2 versions, which would make a tiny file containing only the differences, that can then be applied to a version 1.1 bringing it to 1.2 Example: 1.txtLine 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 2.txtLine 1 Line 2 Line 3 Line 4 Line 5 I'm different Line 6 Line 7 Line 8 Line 9 Line 10 diff 1.txt 2.txt:5a6 > I'm differentdiff.zip Edited April 15, 2005 by Ejoc Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
zvd Posted April 15, 2005 Author Share Posted April 15, 2005 Thanks alot! The windows version of diff you attached does exactly what I'd like. (I searched the web for a utility like that for quite awhile but was unable to find one - small and free that is...) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now