Announcement

Collapse
No announcement yet.

How to higligth line difference in file-report?

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

  • How to higligth line difference in file-report?

    Hello,

    I write a simple script:
    Code:
    criteria rules-based size
    load "folder1" "folder2"
    select diff
    file-report layout:xml output-to:"diff.xml"
    For each files I get:
    Code:
    <filecomparison created="03/04/2019 11:04:36">
            <filename1>file.csv</filename1>
            <filename2>file.csv</filename2>
            <linecomp status="different">
                <text ltid="1">A;B;C;D</text>
                <text rtid="1">A;C;D;E</text>
            </linecomp>
    </filecomparison>
    I'd like highlight line difference as like as:
    Code:
    <filecomparison created="03/04/2019 11:04:36">
            <filename1>file.csv</filename1>
            <filename2>file.csv</filename2>
            <linecomp status="different">
                <text ltid="1">A;<diff>B;</diff>C;D</text>
                <text rtid="1">A;C;D<diff>;E</diff></text>
            </linecomp>
    </filecomparison>
    Or a new element per line container begin/end of each difference.

    How to higligth line difference?

  • #2
    Hello,

    The XML output is a set as a specific construction of nodes, which marks entire different lines but not internally.

    The HTML output for a side-by-side report does include the HTML code for coloring, which you could parse for and find the difference sections. Does this output style work better for you?
    Aaron P Scooter Software

    Comment


    • #3
      My goal is to use Beyond Compare in my CI/CD.

      I try generating html file with:
      Code:
      file-report layout:side-by-side output-options:html-color output-to:"diff.html"
      I get the following error:
      05/04/2019 12:20:00 Fatal Scripting Error: Unexpected argument(s) "output-options:html-color"

      I change layout to html, but that not supported ...
      If html is generated to clipboard, that is not a solution for me

      Comment


      • #4
        Hello,

        The order of commands is important, and you'll need to swap output-to and output-options:
        file-report layout:side-by-side output-to:"diff.html" output-options:html-color

        file-report will try to pick which report the files should use by default, but you can also define a specific report by name, such as text-report.
        Aaron P Scooter Software

        Comment

        Working...
        X