No announcement yet.

Is there anyway to open a comparison with a specific line alignment

  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there anyway to open a comparison with a specific line alignment

    I'm using a tool (Resharper dupfinder) to produce a report of duplicate code blocks within my codebase. The tool provides me with the filename and line-number of each duplicate block as well as a number of lines that it considers to be the same. So, for example I might get a report that says..

    56 duplicate lines
    Fragment1: foo.cs starting at line 945
    Fragment2: bar.cs starting at line 874

    I would like to then use BeyondCompare to give me a manual comparison of the two blocks (since the dupfinder tool does a fuzzy match).

    My question is this. Is there any way to provide command line parameters to bcomp or to script it in such a way that it will open the two files aligned at the line-numbers I specify and, ideally, to force the alignment over a specific number of lines?

    If necessary I will process the dupfinder output and spit the duplicated blocks into dedicated files with all context removed so no alignment is necessary but I would prefer to diff them in context if possible.


  • #2

    Unfortunately, no, BC4 does not support opening entire files but specifying that specific line numbers should be a starting point/match. I believe the closest would be that we do have an Open Clipboard command, so you can copy a section out of a text program, and Open Clipboard in the Text Compare on the Left, then repeat again for the right, but this would remove the context of the files.

    Alternatively, if the files are already open in BC4 but haven't aligned correctly, you can use the Align With command to push a manual alignment of two lines. Or select a block of text and Copy it, then select a different block of text and Compare Selection With Clipboard.
    Aaron P Scooter Software