toxicdav3 Posted June 25, 2009 Posted June 25, 2009 How would i go about comparing 2 files or strings and creating a patch according to its offsets.I found a script to do reading and writing at different positions...http://www.autoitscript.com/forum/index.ph...mp;#entry336438but I don't know how to compare 2 files. Any help, suggestions or pointers would be very appreciated!cheers. Layered Networks - Hosting Solutions
Zaph Posted June 25, 2009 Posted June 25, 2009 This could be a bit of the blind leading the blind since I am a bit new to AutoIt and scripting in general but it shouldn't be too hard to use http://www.autoitscript.com/autoit3/docs/f...ileReadLine.htm to go line by line and compare two .txt files. I have to do the exact same thing for a project I am working on at home so I will give it a try when I get there.
toxicdav3 Posted June 25, 2009 Author Posted June 25, 2009 (edited) Thanks for your reply. The problem with comparing files line by line is... how would I know if half way through line 66 in file 1 is the same as the start of line 57 in file 2? Btw these files will be over 1gb in size.EDIT: Just found these threads, could be useful. http://www.autoitscript.com/forum/index.php?showtopic=34587http://www.autoitscript.com/forum/index.php?showtopic=94799Though they seem a bit too basic for what I need.Just want to compare 2 files and find the hex offsets. Edited June 26, 2009 by toxicdav3 Layered Networks - Hosting Solutions
Zaph Posted June 26, 2009 Posted June 26, 2009 Thanks for your reply. The problem with comparing files line by line is... how would I know if half way through line 66 in file 1 is the same as the start of line 57 in file 2? Btw these files will be over 1gb in size.EDIT: Just found these threads, could be useful. http://www.autoitscript.com/forum/index.php?showtopic=34587http://www.autoitscript.com/forum/index.php?showtopic=94799Though they seem a bit too basic for what I need.Just want to compare 2 files and find the hex offsets.thanks for those two links, everything I need to get it done myself is there. I think everything you need is there too but you will have to do a bit of figuring out for your specific need. Looks like it comes down to opening both files, reading a line from both files as an array, converting the arrays to strings then using StringCompare (in the help files) to compare each line. With some decent if then trees you can have the script generate a report to see when the two files stop being identical. With a bit more you can have the script pick up again when the files start being identical again.you can do it!
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