Menu

#109 Command line save output to file

open
nobody
None
5
2020-02-03
2018-02-26
bryian
No

version 2.15.2. Is it possible to include the functionality to save the output from the command line? For instance WinMergeU /o c:\temp\out.winmerge c:\temp\a.txt c:\temp\b.txt , save the output to c:\temp\out.winmerge

Discussion

  • Takashi Sawanaka

    Do you mean that you want to output a patch or a report from the command line?

    Although it is not yet written in the manual, you can output the report from the command line as follows. Currently, to output a patch from the command line is not supported.

    File comparison report

    "c:\program files\winmerge\WinMergeU.exe" path_to_left_file path_to_right_file -minimize -noninteractive -u -or path_to_report_file
    

    Folder Comparison Report

    "c:\program files\winmerge\WinMergeU.exe" path_to_left_folder path_to_right_folder -minimize -noninteractive -noprefs -cfg Settings/DirViewExpandSubdirs=1 -cfg ReportFiles/ReportType=2 -cfg ReportFiles/IncludeFileCmpReport=1 -r -u -or path_to_report_file
    
    • -minimize: starts WinMerge as a minimized window.
    • -noninteractive: Exit WinMerge after compare / report generation
    • -noprefs: Do not read / write setting information from registry (use default value)
    • -cfg Settings/DirViewExpandSubdirs=1: Expand folder tree after comparison 0: do not expand foler tree
    • -cfg ReportFiles/ReportType=2: Generate HTML-format report
    • -cfg ReportFiles/IncludeFileCmpReport=1: Include file comparison report in folder comparison report 0: do not include
    • -or report file path
     
    • Joshua Morrison

      Joshua Morrison - 2018-07-17

      Hello, I tried using the "File comparison report" code above and the report is not generated for me. When I remove the -minimize and -noninteractive I can see the results are populated, but I cannot figure out what I am doing wrong.

      "C:\Program Files (x86)\WinMerge\WinMergeU.exe" C:\Workspace\Imports\pilot.csv C:\Workspace\Imports\prod.csv -minimize -noninteractive -u -or C:\Workspace\Imports\Results\results.html

       
      • Takashi Sawanaka

        I could not reproduce it.

        Have you checked whether the report file was created immediately after executing the above command?

        Because WinMerge is a GUI program, it returns control to the caller before the WinMerge process exits.

        Therefore, if you wait for a while, the report file may be created.

         

        Last edit: Takashi Sawanaka 2018-07-17
        • Joshua Morrison

          Joshua Morrison - 2018-07-17

          The report file is never generated. I have tried running through both a .cmd file and in the command prompt interface. The command finishes instantly and simply does not seem to make the file. Is there any error logs by winmerge that I could check or do you have any ideas on what do do differently? Thank you for taking the time!

           
          • Takashi Sawanaka

            Unfortunately, there is no winmerge log file.
            It is not user-friendly not to output error messages or logs. We need to improve it.
            By the way, does the C:\Workspace\Imports\ folder exist? If it does not exist, the report file is not created.

             
  • bryian

    bryian - 2018-03-06

    Thanks. Is there an option to generate a summary/project file? Like out.WinMerge?

     
  • Takashi Sawanaka

    Unfortunately, there is no such option. 

     
    • bryian

      bryian - 2018-03-18

      this command WinMergeu c:\temp\log c:\temp\log2 -minimize -noninteractive -noprefs -cfg Settings/DirViewExpandSubdirs=1 -cfg ReportFiles/ReportType=2 -cfg ReportFiles/IncludeFileCmpReport=0 -or c:\temp\outfolder.html will produce a summary file. But is there a way to exclude the identical result from the file?

       
      • Takashi Sawanaka

        Please add -cfg Settings/ShowIdentical=0 option

         
  • tats

    tats - 2018-03-13

    Thank you for this feature.

     
  • Siva Kumar Kapu

    Siva Kumar Kapu - 2018-05-10

    I have some very big text files to compare.
    So in the command line mode for File Comparison is there any way to generate the comparison report showing only the differences ? Also i don't need the html format is there any way to change the html report to txt report with just differences ?

     

    Last edit: Siva Kumar Kapu 2018-05-10
  • Takashi Sawanaka

    So in the command line mode for File Comparison is there any way to generate the comparison report showing only the differences ?

    Please Add -cfg Settings/DiffContextV2=0 to command line.

    Also i don't need the html format is there any way to change the html report to txt report with just differences ?

    Unfortunately, currently, there is no way to create text report..

     
    • Siva Kumar Kapu

      Siva Kumar Kapu - 2018-05-10

      Works like a charm.. Thank you so much for the quick response

       
  • oussema slaimi

    oussema slaimi - 2018-05-31

    Hello,

    I'm trying to do the same here.
    using folowwing commande, the report file is not created.

    winmergeU path_to_file_A path_to_file_A -minimize -noninteractive -noprefs -cfg Settings/DirViewExpandSubdirs=1 -cfg Settings/ShowIdentical=0 -cfg ReportFiles/ReportType=2 -cfg ReportFiles/IncludeFileCmpReport=1 -r -u -or path_to_html_report_file

    any idea why it's not working ?

    Thanks

     
    • RYAN PETRAIN

      RYAN PETRAIN - 2018-08-18

      I am encountering the same thing. I tried running the script as adminsitrator and that did not help either. If I open Winmerge and compare the same two files and go to options and genereate a report with the same filename in the same location, it works.

       
  • Takashi Sawanaka

    Could you see the result when deleting -minimize -noninteractive option from above command line?

    If you specified an incorrect path, Current version of WinMerge may exit without displaying an error.

     
    • Eric A Kohn

      Eric A Kohn - 2019-02-25

      First of, winmerge is an amazing tool which I use probably everyday. thanks for the amazing support!

      Follow up to this issue:

      I tried it with removing the -minimize -noninteractive parameters and it does not work.

      it seems like with the -noninteractive parameter, the application will just exit and do nothing. leaving it out, causes the comparison to run, but a report is still not being generated automatically.

      Any updates will be appreciated.

       
  • Rambabu Garikapati

    Hello,
    Is there any way to generate patch from command line in WinMerge.?(Like the way we are generating from GUI tools->Generate Patch and providing the file names)
    Any help would be appreciated.

     

    Last edit: Rambabu Garikapati 2020-02-03

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.