GWmellon Posted September 13, 2007 Share Posted September 13, 2007 I need to compare two text files and extract the items that are different. For example: File 1 File2 12354.cdf 12354.cdf 56987.cdf 56987.cdf 98745.cdf 78954.cdf 01010.cdf 98745.cdf 01010.cdf In this case the only one I want returned is 78954.cdf. I am currently loading file 1 into an array and searching the array for each item in file 2. It works but for large files it is not speedy. I was wondering if there was a better, quicker way to do this. Seaching the array is a matter of five lines so that does not need to be optimized. I am at the point were I have an ok grasp of AutoIt but still find myself spending an hour coding something and then suddenly discovering what I need in the help file. Not often but enough. Link to comment Share on other sites More sharing options...
ofLight Posted September 13, 2007 Share Posted September 13, 2007 Why reinvent the wheel http://winmerge.org/ There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly Link to comment Share on other sites More sharing options...
GWmellon Posted September 13, 2007 Author Share Posted September 13, 2007 Why reinvent the wheel http://winmerge.org/ Errr, because this is a small part of a bigger program I am working on? Link to comment Share on other sites More sharing options...
DjDeep00 Posted September 13, 2007 Share Posted September 13, 2007 Search the forum for "array" and "compare"...That is the easiest and fastest way. Read the two files into two arrays. Then compare the arrays... Link to comment Share on other sites More sharing options...
ssubirias3 Posted September 13, 2007 Share Posted September 13, 2007 (edited) I am currently loading file 1 into an array and searching the array for each item in file 2. It works but for large files it is not speedy. I was wondering if there was a better, quicker way to do this.If you are familiar with fc.exe you could use Run(@ComSpec...) and pipe the results to a file. If you don't know about fc.exe drop to a command line and type "fc.exe /?"@ofLight - when I looked at that link, the first screenshot reminded me of PSPad and its TextDiff feature. You familar it it?@DjDeep00 - you saying AutoIt reading and comparing large arrays is faster and easier than running a file compare (fc.exe) at the command line? Whoa, anyone with a way to test the speed of each? I'd be interested to know if comparing an array within Autoit is really the easiest and fastest method. I'm all about speed!! Edited September 13, 2007 by ssubirias3 Link to comment Share on other sites More sharing options...
GWmellon Posted September 13, 2007 Author Share Posted September 13, 2007 DjDeep00 - Thanks, I'll give it a look. 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