No announcement yet.

Comparison within a single file

  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparison within a single file

    I am working with a "mapping file" (for Perforce's p4migrate) that contains a list of lines consisting of two strings that are similar except for case, separated by a space, e.g.:
    //depot/Main/...  //depot/main/...
    //depot/Main/WWW/...  //depot/main/www/...
    Is there a way to use BeyondCompare to compare the left-hand side with the right-hand side of all the lines in this file?

    I was thinking an approach would be to compare the file to itself, and have a defined format that considers unimportant the RHS of the first file and the LHS of the second file, which would be the same line. How would this be done?

  • #2

    We don't directly support this, but we do have a workaround that might help:

    Open up the Data Compare session type.
    Load the file twice, once on each side, to compare against itself. Given this example, this should auto-detect "Space" as the delimiter and put each into its own column.

    Next, go to the Session menu -> Session Settings, Columns tab, and click Edit default
    Enable Text important except for "Character Case" and "Whitespace" should both be checked. Click Ok and return to the main columns tab.
    In the Columns tab, in the Right File column, rearrange the columns so that 1 compares to 2, and 2 compares to 1. Select the individual Right File "2:" and use the Up arrow to move it up.

    Click Ok and return to the main view, which should now be performing the compare as you expect.

    How does this work for you?
    Aaron P Scooter Software