Page 1 of 1

Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Fri Feb 12, 2016 3:26 pm
by tatra603
Hello,

I would like to ask You to add a feature to Diff Dirs and Files. I would like to be able to run these tasks (Diff Dirs and Files) also from command line. Then saving the output to XML file for further processing is necessary.

Use case: To be able to script these tasks and perform them regullary from cron.

I already consulted it by Octavian on XML Prague 2016.

Thank You in advance, Stepan

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Fri Feb 12, 2016 5:17 pm
by florin
Hello,

I've just filed a new improvement request on our internal issue tracking system to add the possibility to run the compare tools from the command line and generate output files containing the comparison results in XML format.

You'll be notified when this feature will be available.

Best Regards,
Florin

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Mon Feb 15, 2016 12:12 pm
by Radu
Hi Stepan,

We'll consider this but right now we do not have plans to add command line utilities or API for comparing files.
There are products like Delta XML which could be used for this:

http://www.deltaxml.com/

Regards,
Radu

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Mon Feb 15, 2016 6:37 pm
by tatra603
Radu wrote:but right now we do not have plans to add command line utilities or API for comparing files
Well, I think, that we both are missed something ;-) Just because oXygen already provides almost complete requested functionality, as I discovered it just know while reading diffDirs.bat and diffFiles.bat.

Just run these commands on command line (I am using oXygen Developer 15.2 Professional):

Code: Select all

diffDirs C:\temp\temp\a C:\temp\temp\b

diffFiles C:\temp\temp\a\test.txt C:\temp\temp\b\test.txt
Both these commands opened appropriate oXygen tool and perform desired comparsion. The only few missing features is to:
  • save the result of comparsion into XML file (the feature, I requested in another thread),
  • maybe add the command line switch with the path to the XML configuration file with diff options like oXygen has already in oXygen wide configuration; if no switch provided, use oXygen's one.
So it looks like the complete implementation of command line functionality should not be so hard and time consuming, am I right? Of course, if there would be enough consumer's demand.

Regards, Stepan

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Tue Feb 16, 2016 12:03 pm
by Radu
Hi Stepan,

Ok, initially I understood that you wanted to run the Diff Files and save to a result XML format without any GUI or user interaction, so that you could for example create a script which would save the comparison results for lots of files in a folder (some kind of batch operation).
Would you have a proposal about how that comparison XML file would look like? What would you do with it?

Regards,
Radu

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Fri Aug 19, 2016 12:45 am
by super-structure
Hi,

I think I've run into the exact same limitation as has Stephan. I'm using oXygen Developer v18 and I regularly use the Diff tools to update XSL publishing files between various servers (as well as a few other filetypes).

I would envision the following usage:

Run the Diff tool via command line with some flag set to run "quiet" and another to generate an output XML file. The file would be basically an XML tree much like what is graphically presented in the GUI tool. For each folder or file on either side (for the DiffDir tool, at any rate), an attribute would have a value of "eq", "ne", "x1", or "x2" for "equal", "not equal", "missing on first directory", or "missing on right directory".

I would then parse this file for an attribute other than "eq". If present, then I would re-run the DiffDir tool, launching the graphics mode to investigate further (i.e, flag for "quiet" and generate XML file off).

Lastly, it appears that running the current command line cannot be done in series. That is, once I close the DiffDir GUI tool, it closes the command line opened from a batch file rather than proceeding on to the next line in the batch file. Is this intentional behavior? Perhaps user error on my part (never discount that one!)? Thanks for considering expanding the command line tool. I feel that even with a competing product like MergeXML, I will always prefer the features available in the oXygen suite of tools.

Sincerely,
Jason Coleman
Bentley Systems, Inc.

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Mon Aug 22, 2016 11:33 am
by Radu
Hi Jason,

I will add an issue for your request of generating a report from the Diff Directories tool. But I'm not sure when it will be analyzed, we do not have short/medium term plans for this.
About the way in which our script behaves, you can edit the diffDirs.bat and see what it contains, maybe make changes if you can get it to work the way you want.

Regards,
Radu

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Mon Aug 22, 2016 5:57 pm
by super-structure
Thanks, Radu. I'll investigate using a copy of the diffDirs.bat file.

-Jason

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Thu May 06, 2021 12:16 pm
by kevin1234
Since you already have the command line functionaly to open a diff for two files, it would be nice to also have a quiet mode applying all changes from left to right and saving the right file.

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Thu May 06, 2021 4:59 pm
by tavy
Hello,

Thanks for your feedback.
We already have in plan to implement a merging tool. I added your comment on the issue and increased its priority. When it will be implemented we will update this thread.
Probably will be similar with the Compare Directories and Compare Files script, that can be used to compare two directories/files and get the comparison results in various formats (XML, JSON, YAML). But instead of generating a report will merge the content automatically.

Best Regards,
Octavian

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Sat May 08, 2021 4:10 pm
by Nikonov_94
Thanks, I'll be following the thread then, this merging tool would really make my life easier, too!

Re: Diff Files and Dirs: Enable to run these tasks also from command line

Posted: Mon Oct 18, 2021 4:05 pm
by teo
Hello!

Wanted to update this thread and let you know that we recently released the version 24.0 of Oxygen suite.
Oxygen XML Scripting version 24.0 offers updates and improvements for some of the scripts that are available to provide a variety of functions that can be scheduled or triggered using a command-line tool on Windows, Linux, or macOS.
This release brings the possibility of generating various types of comparison reports, a new merge option, and several improvements for the file and directory comparison scripts.

For more details follow this link: https://www.oxygenxml.com/xml_scripting/whats_new.html

A webinar on 'The New Oxygen Compare and Merge Scripts' is also being prepared.
I invite you on this occasion to register and participate:
https://www.oxygenxml.com/events/2021/w ... ripts.html

Best regards,
Teo