Automated diff reporting - diff

I need a diff tool that has a command line option to create and save a diff report that looks easy to read, something like the html report produced by WinMerge. I have a few hundred files that I need to compare and it's not practical to have to open the files and manually and save the report.

I did find a tool that does exactly that: http://sourceforge.net/projects/diff2html
It's a bash script that uses diff(1) and creates an HTML page from the output with colour-coded diffs.

Have you looked at the command line option in WinMerge? http://manual.winmerge.org/Command_line.html
You might need to use something like AutoHotkey to automate saving the reports created by WinMerge: http://www.autohotkey.com/

Related

Merge 2 pdf files and preserve forms

I'd like to merge at least 2 PDF files into one while preserving all the form elements in the original PDFs. The form elements include text fields, radio buttons, check boxes, drop down menus and others. Please have a look at this sample PDF file with forms:
http://foersom.com/net/HowTo/data/OoPdfFormExample.pdf
Now try to merge it with any other arbitrary PDF file.
Can you do it?
EDIT: As for the implementation, I'd ideally prefer a command line solution on a linux plattform using open source tools such as 'ghostscript', or any other tool that you think is appropriate to solve this task.
Of course, everybody is welcome to supply any working solution to this problem, including a coded solution that involves writing a script which makes some API calls to a pdf-processing library. However, I'd suggest to take the path of least resistance first (CMD Solution).
Best Regards
EDIT #2: Well there are indeed several CMD tools that merge PDFs. However, these tools don't seem to, AFAIK, to preserve the forms in the original PDFs! These tools appear to simply just concatenate the printouts of all those PDFs into a single Printout, which is then presented as a single PDF.
Furthermore, If you printout a PDF file with forms into a file, you lose all the forms in it. This clearly not what I'm looking for.
I have found success using pdftk, which is an open-source software that runs on linux and can be called from your terminal.
To concatenate multiple pdfs into one (and preserve form-fillable elements), you can use the following command:
pdftk input1.pdf input2.pdf cat output output-file.pdf

How to export a PDF with figures on multiple pages?

I am trying to export a larger number of Matlab figures that are generated in for loop to a single PDF file. Right now the best thing I could come up with is to all print them to a PostScrip file using the -append option like this:
print('Temp_Plots','-dpsc','-append')
After that I could convert the PS file to a PDF file. This workflow was okay until I started to use plots with 2 y axis. Unfortunately it seems like Matlab's PS export cannot properly handle this situation and does not color the lines appropriately.
As there is no -append option for the direct PDF export what other methods do I have to append all my plots to a single file without losing the assigned colors or other hickups?
I would recommend trying out the publish command and push that to its limits first.
Following the documentation:
options = struct('format','pdf','outputDir','C:\myPublishedOutput');`
publish('myCode.m',options);
Take a look at Publishing Markup to see how to get the look you want.
This search brings up some possibly related posts, but none that I saw that directly match your issue.
References:
1. Publishing Markup (Mathworks)
2. Output Preferences for Publishing (Mathworks)
3. Publishing M-Files in MATLAB
4. Publish Your Work in Matlab

MATLAB publish, formatting LaTeX output header

I have thousands of lines of MATLAB ranging over several scripts that I have commented and broken up into cells. I would now like to publish. I have some universal formatting that I would like to apply. I would also like to be able to publish each script independently. At the moment I have written all these formats into a file called 'Formats.m'. So at the start of every script it publishes with the word 'Format' at the top.
Is there a way I can call in the formatting file without seeing the name published in the final script?
publish has an option codeToEvaluate which might be what you're looking for here.
To publish foo, but run Format first, try this:
>> opts.codeToEvaluate = 'Formats; foo';
>> publish('foo',opts)
If you're working from the Editor, the same option is available as a publish configuration.

How to most effectively automate repetitive Excel task?

I want to automate Excel using Perl to do the following task(s):
For a list of Excel .xls files, do the following:
Open the file
Set Format to CSV
Save the file under the original filename and directory, but replace the extension "xls" with "csv"
Close the file
End
I found how to open files, even how to save them. I did not find how to change the fileformat/save as a different format. There shall be no user dialogs popping up, it should be fully automated. The Excel file list I can generate myself, a parameterized "find" or maybe "dir" should suffice.
If you are using Excel automation a great help is Excel itself. Use the VBA environment (Alt+F11) to get help for the Excel objects you want to use.
The objectbrowser (F2) is very valuable.
Workbook.SaveAs([Filename], [FileFormat], [Password], [WriteResPassword], [ReadOnlyRecommended], [CreateBackup], [AccessMode As XlSaveAsAccessMode = xlNoChange], [ConflictResolution], [AddToMru], [TextCodepage], [TextVisualLayout], [Local])
Searching for CSV in the object browser will show Excel constants with their values, since you probably cannot use these Excel constants in Perl.
See Spreadsheet::ParseExcel and xls2csv, they will help you.

Getting more out of *.diff -files

I wonder if there are tools to show *.diff files used in patching related to debian packaging. What I need from the tool is that it could just read the diff file and show the actual files changed with changed rows, like kdiff or meld would do when comparing directly 2 different files. Or maybe I have totally wrong kind of approach to this, maybe I should ask how can I get more out of diff-files?
Kompare is able to open a .diff, and it shows you the files changed at the top, alist of changes of the selected file, and a side by side diff (for the lines that it is able to extract from the .diff.
However, when I feed it a debdiff, it got confused. The diff did not have === file headers, only --- and +++ headers, and so it included the changes from the /debian/changelog, /debian/copyright, and /debian/rules with in the /debian/control file. Ymmv.
Screenshot: http://imagebin.ca/view/fNWEzx.html
The Debian diff format seems to be a special diff format. As my short google search didn't result in a graphical tool, which could handle these files in the way normal diff tools do, I'm not sure, if such a tool exists. Perhaps you could try to convert these debiff files to normal diff files (I didn't find a tool, which would do that, either).
There is a tool to visualize changes in Linux packages (Deb, RPM, TAR.GZ, etc.) - pkgdiff.
Usage:
pkgdiff -old OLD.deb -new NEW.deb
Sample reports:
http://lvc.github.com/pkgdiff/pkgdiff_reports/libqb/0.4.1_to_0.8.1/changes_report.html
http://lvc.github.com/pkgdiff/pkgdiff_reports/gstreamer/0.10.23-i486-1_to_0.10.32-i486-1/changes_report.html