Announcement

Collapse
No announcement yet.

Script to create folder comparison report

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script to create folder comparison report

    Could you please tell me how to write a SCRIPT for

    1) Compare 2 folders ( directory and sub directory) and show difference in the content of files.
    For every file which is different a different comparison file (in html) needs to be created.

    For Example
    H:\new and H:\old are to be compared
    if files in H:\new are t1.txt,t2.txt,t3.txt and
    if files in H:\old are t1.txt,t2.txt,t3.txt

    if files H:\new\t1.txt is same as H:\old\t1.txt other two files are different
    then comparison should have
    a) t2.html (containing side-by-side layout difference for t2.txt in old and new directory)
    b) t3.html (containing side-by-side layout difference for t2.txt in old and new directory)


    With the below script we can compare only 1 file whose names are known :

    file-report layout:side-by-side output-to:"%3\statisticsreport.html" options:ignore-unimportant,display-context &
    output-options:html-color &
    H:\new\t2.txt H:\old\t2.txt

    Can we get all file names which are different?


    2) Show list of files in the directory using script


    Example::

    Rules-Based Comparison of
    H:\new to H:\old
    4 files in 1 folders

    3 files match exactly
    ---------------------
    t1\a1.txt
    t1\a2.txt
    t1\a3.txt

    1 files don't match
    -------------------
    t1\ss.txt


    Could you please help me out at the earliest:

  • #2
    Hello,

    1) Script cannot compare the individual files and generate individual report htmls. You can easily run a comparison, select Different files, and generate a file report for the different files. To preview what this would look like, launch the application, select multiple files, and go to the Actions menu -> File Compare Report.

    Do any of these reports meet your needs?

    Example Script (see other examples in the Help file under Using Beyond Compare -> Automating with script: Sample Scripts):
    log verbose logfile%date%.txt
    criteria rules-based
    load c:\folder1 c:\folder2
    expand all
    select diff.files orphan.files
    text-report layout:side-by-side output-to:report.html

    2) Open the Folder Compare report, and go to the Session menu -> Folder Compare Report. Pick Summary List and uncheck all of the Columns. Does this report meet your needs?
    Aaron P Scooter Software

    Comment


    • #3
      Script to create folder comparison report

      Thanx Aaron !!!

      1) For point 1 , my problem is solved

      2) For point 2 , i need to create a script to compare folders and generate .txt report

      Currently using the script below::
      compare rules-based
      folder-report layout:side-by-side options:display-all,column-none output-to:result.txt

      The report does not provide count of number of files match exactly, count of number of files dont match,

      number of folders compared

      We can get the result using
      Actions -> compare contents -> rule based -> save result to file.

      Could you please guide me how to get the same result using script

      Comment


      • #4
        Those specific results are not script-able. You could script the report I mentioned if it meets your needs (it should be close in terms of output if you disable the other columns). It would be the "layout:summary" type of report. It would also work on the selection of files, much like the previous script (instead of layout:side-by-side, layout:summary).

        How does that work for you?
        Aaron P Scooter Software

        Comment

        Working...
        X