How to tell WinMerge to ignore binary files in folder compare? - diff

Is it possible to make WinMerge ignore binary files and do only text files comparison when comparing folders?

Winmerge does not detect file structures to check if they are text or binaries. However, you can create filters based on filenames or extensions to ignore certain files.

You can specify file extensions to compare this will make your compare easy.Or create a file filter. Here is the link.

Related

I have mutiple folders I want to include in doxywizard

I have mutiple folders I want to include in doxywizard. Any Idea how can I do that? Currently If I select folder with multiple subfolder in it and when I run doxygen, It is not showing me any output.
When having specified just folders in the INPUT tag the files here are handled but not the files in subdirectories. For the later ones one needs the RECURSIVE tag (from the documentation):
RECURSIVE
The RECURSIVE tag can be used to specify whether or not subdirectories should be searched for input files as well.
The default value is: NO.

How to develop additional File Formats for BeyondCompare

I see that BeyondCompare can be extended to include additional file formats, as in Additional File Viewer Rules for Beyond Compare 2 and also Additional file format downloads for version 3 but after a quick initial search I don't see how user's develop these special viewers. Is that documented anywhere?
I downloaded a few additional viewers which are handily imported via the BCFormats.bcpkg file
C:\Program Files (x86)\Beyond Compare 3\Helpers>dir /b /s
C:\Program Files (x86)\Beyond Compare 3\Helpers\HtmlTidy
C:\Program Files (x86)\Beyond Compare 3\Helpers\PdfToText.exe
C:\Program Files (x86)\Beyond Compare 3\Helpers\XLS_to_TAB_Single.vbs
C:\Program Files (x86)\Beyond Compare 3\Helpers\HtmlTidy\HtmlTidy.exe
C:\Program Files (x86)\Beyond Compare 3\Helpers\HtmlTidy\XML_tidied_sorted.bat
C:\Program Files (x86)\Beyond Compare 3\Helpers\HtmlTidy\XML_tidied_sorted_config.txt
What's the design to these things, are they something to the effect of a command line tool that reads in a text file as the first argument and outputs the converted file to standard output?
They are command line tools that preprocess a file before it is loaded for comparison. The first argument is an input file and the second argument is an output filename. As an example, the pdftotext.exe tool extracts a .pdf file to a plain text .txt file, then displays the temp file in Beyond Compare's Text Compare.
See Beyond Compare's help file topic Text Format Conversion Settings for details.
In another question (Compare Json Files in Beyond Compare
) I walk through a step by step example that demonstrates some json conversion for diffs to lend a concrete example to this question. What Chris said above is spot on, it's basically a console application that uses some fixed argument positions to take in the input file path as well as an output file path that the text representation will be written to.
$myConvertingConsoleApp $inputFilePath $outputFilePath
Beyond compare will actually provide the actual arguments used by the console application during the conversion process.
It's worth noting that the input file need not even be a text file so long as you can come up with some sane textual representation of the file format that makes sense for diff algorithms to operate upon.

Select all text in files

Is there a way in eclipse to view the code from multiple files in a temp file. So if I highlight multiple .java files I can view the code from all files concatenated top-down as a single file instead of copying/pasting the files into one ?
Could not find an eclipse way of doing it. But to use dos just cd into the package you want to merge the files and use - "copy *.java merge.java" This will merge all the files into one file called merge.java . Better than nothing.

How to compare two .ear files recursively

I'm modifying a build process and I need to do a complete comparison of the contents of two .ear files. That means recursively comparing each archive in the .ear. These .ear files have archives that contain archives.
I've looked at Beyond Compare and Archive Analyzer, but they only do one level at a time. I have to manually drill down into each archive. I'm looking for something more automatic.
Eclipse and UltraCompare do a binary comparison of the two .ears which is not what I want.
How can I compare two .ear files recursively?
zipdiff provides a very good open source solution.
My problem turned out to be more than just expanding the .ear file recursively (I wrote a Java class to do that - recursion made it simple.) Once the .ear files are expanded I have to diff the directories to check for any changes. If anything other than timestamps changed then I know that the build is producing a different binary.
The second problem is that our build process generates hundreds of .xml files and subsequent builds re-generate those .xml files with the elements in different order. I'm not sure why. When I expand two .ear files made by back-to-back builds with no changes to anything the diff of the resulting directories shows hundreds of .xml files with diffs, even though they are functionally equivalent.
In addition to expanding the .ear files recursively I need to do a diff and exclude the .xml files in certain directories. I thought that Cygwin diff would do this, but the --exclude switch doesn't recognize any path information:
Cygwin diff won't exclude files if a directory is included in the pattern
If I don't find a solution to this I'll write another Java class to step through the whole directory structure doing a single level diff in each directory and excluding the .xml files in the appropriate directories.
I have the feeling that I'm re-inventing the wheel, but I can't find a wheel right now.
In Beyond Compare go into the Session Settings dialog, and on the Handling tab is an Archive Handling option. If it's set to As folders always BC will treat archives just like folders, so it's fully recursive.

How do you compare the content of two archive files programmatically?

I'm doing some testing to ensure that the all in one zip file that i created using a script file will produce the same output as the content of a few zip files that i must manually click and create via web interface. Therefore the zip will have different folder structure.
Of course i can manually extracted them out and using my powerful eyeball technique to scan them or even lazier i can write a script to do that, but before i invest more time and get accused by my boss for company time robbery, i'm asking if there's a better way to do this?
I'm using perl LAMP stack by the way.
thanks.
You can use perl's Archive::ZIP or Python's zipfile to extract the filenames, sizes and CRC checksums of the files in the archives. Create a file which contains the results sorted by file name (ignore the path).
For your smaller ZIPs, merge the results of the script (cat list1 list2 list3 | sort).
Now, you can use diff to compare the results.
I can wholeheartly recommend Beyond Compare. Unless you're really getting underpaid, it's the biggest bang for your (bosses) buck.
[Edit] I seem to have scanned over the different folder structure, sorry about that.Beyond Compare can compare all files in folders with the same folderstructure. It does not have (I believe) the intelligence to go searching for matches in files in different folders.
Regards,
Lieven
Create a crc checksum for your files.
If your checksum is the same for the original files and the unzipped files, you can be sure the files are the same. And even works for non text data.
A checksum be easily be created with an external program such as "SFV Checker" or programmatically (.net/java for example include libraries to do this).
Taking a cue from Carra's answer...if A.zip is your single big archive and B.zip is the archive generated through the web then use the following algorithm
Extract all files from A.zip and recursively (w.r.t folders) compute the checksum of the files present in the folder (using cksum, md5sum etc) where the contents were extracted and save this information after sorting it (pipe it through sort) to a file (say A.txt)
Do the same for B.zip and generate B.txt
Compare A.txt with B.txt they should be exactly the same.
OR
Use unzip -l to get file/directory lists for both the (zip) archives and then flatten the hierarchy of the user generated zip file and compare with the contents of your script generated zip file using some thing like diff. By flattening of hierarchy I mean you may need to do some kind of pre-precessing on one or both lists before you can do a meaningful comparison with diff.