Announcement

Collapse
No announcement yet.

compare files and write a report containing only certain keywords

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

  • compare files and write a report containing only certain keywords

    I want to compare the differences between all the files in the two folders
    so:
    BCompare.exe @D:\11\diff.txt
    diff.txt:
    load "D:\11\20190626\20190626\precode" "D:\11\20190626\20190626bak\update\20190626"
    expand all
    select all
    text-report layout:side-by-side options:ignore-unimportant,display-mismatches,line-numbers title:"report" output-to:"D:\11\report.html" output-options:html-color

    What should I do if I want to generate discrepancy reports related to certain keywords?
    for example
    “WenZ”

  • #2
    Hello,

    I would suggest using the graphical interface to save a specific Folder Compare session, in which you can define specific child session importance so that "Keyword" is Important, and Everything Else is Unimportant. With this setup, script can then load the saved session, using the new importance definition, and mismatches would only relate to instances of the Important Keyword with ignore-unimportant enabled.

    First, launch the Tools menu -> File Formats, edit your specific format for these file types and add a new Grammar Element for your 'keyword'. Note, some existing file formats have a "Keyword" element already defined for that coding definition. I'd recommend using a new custom phrase for your "certain keywords" that reflects their title and is not an existing grammar element name definition, unless that definition applies logically.

    To configure this, load your two folders in a new Folder Compare. Double click a pair of files to launch the child Text Compare session. Here, you can then go to the Session menu -> Session Settings, Importance tab, and uncheck all items (all other element names), and leave your "Custom Element Name" checked. Update the bottom dropdown from "Use only for this view" to "Use for all files in parent session". Click Ok, and then close the child tab, and re-save the parent Folder Compare.

    Double clicking any file in the parent folder compare should then use these new defaults for the comparison (as will any report generation).

    Depending on your needs, you can also update your script to only select files with this difference present. In the Folder Compare's Session Settings, enable Rules-based content comparison (leave other defaults enabled), then re-save the Folder Compare session:

    load "saved session name"
    expand all
    select all.newer.files all.older.files all.diff.files all.orphan.files
    text-report layout:side-by-side options:ignore-unimportant,display-mismatches,line-numbers title:"report" output-to:"D:\11\report.html" output-options:html-color
    Aaron P Scooter Software

    Comment

    Working...
    X