Sign in to follow this  
Followers 0
fraudh8er

Compare text files

5 posts in this topic

Any thoughts on how you would make a scirpt compane 2 text files. more importantly i have 2 folders, each with a set of files. I will need to find the fiels that are misisng in each and then go threw the text fiels in folder 1 that are named the same as dir 2 and compare the actualy text withing them. I know it sounds crazy, but what can I say.

Vw

Share this post


Link to post
Share on other sites



Okay let me see if I have this correct.

1. You need to compare 2 folders and check to make sure they both have the same files.

2. You then need to check the actual contents of those files to make sure that they are not just the same name, but the same data?

If the above is correct then here are my thoughts on how to go about this.

Research either Larry's Function or Ezzetabi's Function in the Scripts and Scraps forum (both I think are called FileSearch or something similar). Those will help you find the files and/or folders you need to find.

You can also research FileFindFirstFile() and FileFindNextFile() in the helpfile. I used those to create a search function to my own needs as theirs was too elaborate and I like using all of my own stuff. Also you may want to just look at all the File*() functions. (Such as... FileExists(), FileCopy(), FileMove(), FileOpen(), FileClose(), FileReadLine().) I would use the FileReadLine() to check the contents of both files line by line. You can output it to another file if they arent equal using FileWriteLine() I hope you get my meaning... Look up the File*() functions they are very useful.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Yes, you understood me correctly, when I get home I will see what I can come up with. My other question would be how to you prompt the use for the folders, can you use the built in windes dialog for finding a folder or wil they ahve to type the path in?

BUt thank you

Okay let me see if I have this correct.

1. You need to compare 2 folders and check to make sure they both have the same files.

2. You then need to check the actual contents of those files to make sure that they are not just the same name, but the same data?

If the above is correct then here are my thoughts on how to go about this.

Research either Larry's Function or Ezzetabi's Function in the Scripts and Scraps forum (both I think are called FileSearch or something similar). Those will help you find the files and/or folders you need to find.

You can also research FileFindFirstFile() and FileFindNextFile() in the helpfile. I used those to create a search function to my own needs as theirs was too elaborate and I like using all of my own stuff. Also you may want to just look at all the File*() functions. (Such as... FileExists(), FileCopy(), FileMove(),  FileOpen(), FileClose(), FileReadLine().) I would use the FileReadLine() to check the contents of both files line by line. You can output it to another file if they arent equal using FileWriteLine() I hope you get my meaning... Look up the File*() functions they are very useful.

JS

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

Let me check, but I think you can use a dialog box. :)

Yup just checked and it is FileOpenDialog()

See what that does for you.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

And then there's also third-party apps (search these forums for links to them)..

Examdiff - free

BeyondCompare - not free, but literally "Beyond compare"

HTH

:)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0