Questions tagged [file-comparison]

File comparison is the act of comparing one file's properties with another's.

Use this tag for questions related to comparing the size, content, etc. of two or more files.

146 questions
178
votes
11 answers

Comparing two files in linux terminal

There are two files called "a.txt" and "b.txt" both have a list of words. Now I want to check which words are extra in "a.txt" and are not in "b.txt". I need a efficient algorithm as I need to compare two dictionaries.
Ali Imran
  • 8,249
  • 3
  • 35
  • 46
169
votes
2 answers

Tool to compare directories (Windows 7)

Due to some SVN movement I got disconnected from SVN while I was in middle of a fairly large enhancement. Now I have my current workspace (with changes and disconnected from SVN) and new workspace (latest from SVN). I need to manually update the new…
Mukul Goel
  • 8,317
  • 5
  • 34
  • 72
23
votes
2 answers

How do I compare two files in Ruby 1.9?

In Ruby 1.8, I would call File.compare() from the "ftools" library to easily compare the contents of two files. However, in Ruby 1.9, "ftools" is replaced by "fileutils", which doesn't have a "compare" method. What's the equivalent call?
Craig Walker
  • 44,465
  • 49
  • 146
  • 204
10
votes
4 answers

Programmatical approach in Java for file comparison

What would be the best approach to compare two hexadecimal file signatures against each other for similarities. More specifically, what I would like to do is to take the hexadecimal representation of an .exe file and compare it against a series of…
Carlos
  • 5,256
  • 19
  • 64
  • 113
8
votes
4 answers

Reliable way to (programmatically) compare PDFs?

Possible Duplicate: Tool to compare large numbers of PDF files? I am in the classic scenario where the business gives you a bunch of new pdf forms for the new year with no revision notes whatsoever and you are supposed to figure out what's…
JohnIdol
  • 45,251
  • 58
  • 153
  • 235
8
votes
4 answers

What tool can do a visual comparison of two sections within the same file?

Good file comparison tools were already discussed to the pain, but my problem is more exotic. Is there any visual text comparison tool (like WinMerge) that would allow me easily do visual comparison on two sections within the same file? I have…
Ignas Limanauskas
  • 2,276
  • 6
  • 26
  • 32
7
votes
3 answers

How can I know if an "assembly" really did change?

I created a simple "Hello World" application in VS2005. It's a straight-forward console application; it only contains the following lines: Console.WriteLine("Hello World"); Console.ReadLine(); When I tried to rebuild the same console application…
Ian
  • 5,349
  • 9
  • 54
  • 91
7
votes
8 answers

How can I compare two files in golang?

With Python I can do the next: equals = filecmp.cmp(file_old, file_new) Is there any builtin function to do that in go language? I googled it but without success. I could use some hash function in hash/crc32 package, but that is more work that the…
rvillablanca
  • 1,355
  • 3
  • 15
  • 32
6
votes
2 answers

filecmp.cmp() ignoring differing os.stat() signatures?

The Python 2 docs for filecmp() say: Unless shallow is given and is false, files with identical os.stat() signatures are taken to be equal. Which sounds like two files which are identical except for their os.stat() signature will be considered…
martineau
  • 99,260
  • 22
  • 139
  • 249
6
votes
4 answers

Shell Script compare file content with a string

I have a String "ABCD" and a file test.txt. I want to check if the file has only this content "ABCD". Usually I get the file with "ABCD" only and I want to send email notifications when I get anything else apart from this string so I want to check…
5
votes
5 answers

Existing solution for file deltas/versioning in Java

When versioning or optimizing file backups one idea is to use only the delta or data that has been modified. This sounds like a simple idea at first but actually determining where unmodified data ends and new data starts comes accross as a difficult…
James P.
  • 17,929
  • 27
  • 89
  • 147
5
votes
2 answers

Open new tab in existing meld instance via a command line

Is there a way to start new file comparison in an existing meld instance with a command line (like terminal) or programmatically. For example, following two commands start two instances of meld $ meld ./1/a1.txt ./2/a2.txt & $ meld ./3/a3.txt…
Loom
  • 9,042
  • 19
  • 50
  • 102
5
votes
2 answers

windows comp command in batch script: remove prompts

Every time I use the Windows comp command, a message containing: Compare more files (Y/N) ? is shown. Can I avoid it by typing N by default? thanks
4
votes
1 answer

problem with output of side difference using sdiff in unix

I am using the following sdiff command to get the side-by-side difference of two files. Column width is given as one of the options sdiff -w170 /tmp/captureFile /tmp/referenceFile (or diff -y ) if i use -w 130 then some characters are stripped.…
vaichidrewar
  • 8,383
  • 15
  • 66
  • 85
4
votes
4 answers

how to compare two files and print mismatched line number in python?

I have two files which contains same number of lines. "file1.txt" contains following lines: Attitude is a little thing that makes a big difference The only disability in life is a bad attitude Abundance is, in large part, an attitude Smile when…
user3116273
  • 61
  • 2
  • 10
1
2 3
9 10