File Compare
-
I'm writing a C++ application that needs to compare two text files for differences (addition/changes/deletion of an line), so some source code for comparing is required that is fast (and accurate) as some files maybe more than 5MB in size, but usually will be several hundred KB. The output could be either to another text file or a List Control. Any recommendations as to what to use, or any examples available would be most appreciated.
-
I'm writing a C++ application that needs to compare two text files for differences (addition/changes/deletion of an line), so some source code for comparing is required that is fast (and accurate) as some files maybe more than 5MB in size, but usually will be several hundred KB. The output could be either to another text file or a List Control. Any recommendations as to what to use, or any examples available would be most appreciated.
Why don't you take a look at WinDiff? Alternatively you could consturct 2 CStdioFile obejcts, ReadLine() 'em and store the values in CStringArray's. Those in memory representations can be read faster than the actual files. Actually it reminds me of a similar task I had to do when I learend programming, so feel free to ask me any questions ;-)
-
I'm writing a C++ application that needs to compare two text files for differences (addition/changes/deletion of an line), so some source code for comparing is required that is fast (and accurate) as some files maybe more than 5MB in size, but usually will be several hundred KB. The output could be either to another text file or a List Control. Any recommendations as to what to use, or any examples available would be most appreciated.
To compare files as big as 5MB is crucial task , putting the data in memory & comparing will be fast. :-> can suggest one tip , keep a log of the file last modified and check for the size and time of modification . If there is not change in size , then u dont need to compare the data of file. :cool: Vikas Amin Embin Technology Bombay vikas.amin@embin.com
-
I'm writing a C++ application that needs to compare two text files for differences (addition/changes/deletion of an line), so some source code for comparing is required that is fast (and accurate) as some files maybe more than 5MB in size, but usually will be several hundred KB. The output could be either to another text file or a List Control. Any recommendations as to what to use, or any examples available would be most appreciated.
You can find WinDiff sources, or have a look at WinMerge.sf.net. Comparison itself could be a hardest part, since there are plenty of algorithms. You can search for MYERS's Difference Algorithm. Igor Green http://www.grigsoft.com/ Compare It! + Synchronize It! - files and folders comparison never was easier! Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
I'm writing a C++ application that needs to compare two text files for differences (addition/changes/deletion of an line), so some source code for comparing is required that is fast (and accurate) as some files maybe more than 5MB in size, but usually will be several hundred KB. The output could be either to another text file or a List Control. Any recommendations as to what to use, or any examples available would be most appreciated.
P Gibson wrote:
Any recommendations as to what to use, or any examples available would be most appreciated.
Go to the top of this page and type 'diff' into the Search field. ;)
-
I'm writing a C++ application that needs to compare two text files for differences (addition/changes/deletion of an line), so some source code for comparing is required that is fast (and accurate) as some files maybe more than 5MB in size, but usually will be several hundred KB. The output could be either to another text file or a List Control. Any recommendations as to what to use, or any examples available would be most appreciated.
P Gibson wrote:
so some source code for comparing is required that is fast (and accurate) as some files maybe more than 5MB in size, but usually will be several hundred KB.
What about using Memory Mapped Files, Link :- http://www.codeproject.com/win32/cmemmap.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV