Announcement

Collapse
No announcement yet.

Ignore WhiteSpace

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

  • Ignore WhiteSpace

    Hi all,

    How to ignore whitespace while comparing files in two different folders with the following script.
    Eg: Folder1\file1
    Content:"abcd"

    Folder2\file1
    Content: "abc d"

    log verbose D:\Venkey\BeyondCompare-ScriptTool\Output\logfile.txt
    criteria binary
    load D:\Venkat\Compare1 D:\Venkat\Compare2
    expand all
    select all
    folder-report layout:summary options:display-mismatches output-to:\Venkey\BeyondCompare-ScriptTool\Output\report1.html &
    output-options:html-color

    Please help me on this.
    Thanks
    Venkat

  • #2
    Hello,

    You would want to use a Rules-based compare instead of Binary. Binary is bit-by-bit, while Rules-based is what you see when you double click on the files and view the text differences.

    You will need to set your default session settings to ignore whitespace differences, and may have to edit the grammar elements of specific file formats to also ignore whitespace.

    Basically, you should be able to double click on a pair of files, click Show Whitespace, and it will appear as Blue. Then, toggle on Ignore Unimportant Differences in the Folder Compare (to turn the option on graphically). Test the generation of the report in the graphical interface (Session menu -> Folder Compare report).

    Here is a KB article on defining specific text as Unimportant:
    http://www.scootersoftware.com/suppo...mportantv3.php

    Then try to run your script again.
    Aaron P Scooter Software

    Comment


    • #3
      Hello,

      I just saw your other, duplicate post and realized this is in the BC2 forum.

      The concept is still the same, but that article is for BC3. For BC2, go to the Tools menu -> Options: Rules section. Go to each file type you are having trouble, go to the Importance tab, and check Leading, Embedded, and Trailing whitespace, and blank lines. If any whitespace is inside of a String element, it will be considered important.
      Aaron P Scooter Software

      Comment


      • #4
        Objective: Required to show the output report with only content differed and orphaned files but not the files differing with Leading,Embedded,Trailing whitespaces and blank lines using folder-report in Scripts.
        As Iam using BC2, I followed the step by configuring the rule section where i have checked Leading,Embedded,Trailing and Blank lines.And i got report only when I use 'file-report' in the script by giving the options 'ignore-unimportant' and not folder-report. But I don't want to show the name of the files which are differed with 'blank lines', 'Trailing whitespace', 'Embedded Whitespace' and 'Leading Whitespace' in the folder-report using script.

        Can you please advice me on this?

        Thanks
        Venkat

        Comment


        • #5
          Hello,

          Make sure that Ignore Unimportant Differences is toggled On in the graphical interface toolbar (this also enables it in future runs, including script).

          set the criteria rules-based before performing the load command to run a rules-based comparison on all of the files. This will then use the default Rules (and whitespace handling) to determine which files are equal.

          I recommend testing in the graphical interface first, since each script command is literally an action you could take using the graphical interface. Create a session that uses Rules-based comparison, load it, run the Expand All command. Check to see if the expected files are properly ignored (using the Ignore Unimportant Differences toggle). Then generate your report.
          Aaron P Scooter Software

          Comment

          Working...
          X