Show CRLF vs LF as unimportant difference in text comparison

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DimaB
    New User
    • Aug 2011
    • 1

    Show CRLF vs LF as unimportant difference in text comparison

    Hi,

    BC3 has the following options regarding the difference in line endings, when comparing text files (e.g. MIX vs UNIX):
    1. Totally ignore the difference, the default (e.g. lines shown as equal)
    2. Show whole lines as *important* difference (if Settings->Importance->Compare line endings is checked)
    3. Show the difference in Hex Compare.

    Is it possible to setup BC3 to show the lines differing in EOL style as unimportant difference?

    It would also be nice to have an option to normalize the line ending on save (e.g. convert to LF), at least for source code formats.

    Thanks
    Dima
  • Aaron
    Team Scooter
    • Oct 2007
    • 15995

    #2
    Hello,

    BC3.3.1 has two options, Compare Line endings can be marked as on or off. If off (default), BC3 considers the difference between line endings (PC vs Linux) as unimportant, and they will be ignored as a difference. If enabled, it will show up as a red difference. Enable Show Whitespace to see the line ending characters.

    The other option is for Orphan Lines are always Important, which can mark a line with just a line ending as Important or Unimportant.

    Would unchecking the first option in the Session Settings -> Importance tab (Compare Line Endings) work for you? As a session setting, it will need to be saved with a session, or set as a session default.

    If you use the File -> Save As option on a specific pane, you should be able to normalize/set to a specific Line Ending format.
    Aaron P Scooter Software

    Comment

    • jjaaskel
      New User
      • Mar 2012
      • 2

      #3
      I have BC 3.3.3 and problem is that currently my compare is not showing those unix / dos line endings as difference, but if I open hex compare I can see those.

      I just can't find this option anywhere:
      "Would unchecking the first option in the Session Settings -> Importance tab (Compare Line Endings) work for you? As a session setting, it will need to be saved with a session, or set as a session default."

      i.e. in my session settings I cannot see importance tab :s

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 15995

        #4
        Hello,

        The Importance tab is part of the Text Compare session settings. You would need to be viewing the files specifically, or altering the defaults from the Home screen.

        If you are working from the Folder Compare (rules-based comparison), you will need to double click and view a specific pair of files, then update the default settings (using the option to "Also Update session defaults" from "use for this view only", or from the Home screen, in the Saved Sessions list, the Edit session defaults folder, Text Compare). I also recommend enabling Show Whitespace in the Text Compare to visually see the End of Line character symbols and their coloring.
        Aaron P Scooter Software

        Comment

        • jjaaskel
          New User
          • Mar 2012
          • 2

          #5
          Thank you, this helped!

          Comment

          • csguser
            New User
            • Jun 2012
            • 1

            #6
            I have this exact issue with BC 4.2.2 and I don't get the resolution given here. I can either have line endings ignored or I can check the box in rules/importance for Compare Line Endings in which case those lines are marked as important. What I want is BC to compare line endings but treat them as it treats other whitespace (ie unimportant).

            Comment

            • Aaron
              Team Scooter
              • Oct 2007
              • 15995

              #7
              Hello,

              Could you clarify? You want the line endings to be compared but unimportant? Whitespace and Line Endings have different checkboxes in the Session Settings, Importance tab. Each is individually enabled (Important) or disabled (Unimportant). The main difference is line endings do not get a blue coloring if Unimportant.

              If you need line endings to be Unimportant (so files are not marked as different in a rules-based compare, overall status shown in the lower left status bar of the Text Compare or in the center column of the Folder Compare), then the Compare Line Endings checkbox should be unchecked. If you need to find them, then it should be Important/checked.
              Aaron P Scooter Software

              Comment

              Working...