Announcement

Collapse
No announcement yet.

Force lines to align by line number

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Force lines to align by line number

    I have two files in which I know each line in one file must match the same line in the other file (i.e. line 25 in the first file should match line 25 in the second).

    I want the lines to line up by line numbers, but because of some of the differences, the lines are being misaligned (i.e. line 25 in the first file is being aligned with line 26 in the second).

    Is there a way I can align all the lines by line number?
    Doing it manually, line by line, is not the answer I'm looking for (these files are several hundred lines long, with several dozen misalignments).

  • #2
    Hello,

    Go to the Text Compare's Session menu -> Session Settings, Alignment tab. Here you can customize various alignment settings or set it to "Unaligned", which would not perform any alignment and would simply set the files side by side (aligning them by line number).

    This option can apply for the current view, or you can set it as a default behavior on the Home Screen, in the Edit session defaults folder, select Text Compare, Alignment tab.
    Aaron P Scooter Software

    Comment


    • #3
      There is no Session menu when I'm comparing files. This menu only shows up when I compare folders. I believe "File Viewer" is being used when comparing files.

      Comment


      • #4
        Hello,

        Sorry, I did not notice you had posted in the BC2 forum. For BC2, you will need to use the Tools menu -> Options, Rules, edit your current rule, and in the Alignment tab set the Skew Tolerance to "1". How does this work for you?
        Aaron P Scooter Software

        Comment


        • #5
          I am using version 4.2.10. I am trying to compare two files where I want the lines to compare with the exact same line in both files. So if line 10 in file A has an X and Line 11 is blank and Line 10 in B is blank but line 11 has an X I want this to show as two differences. Regardless of how I set alignment to Unaligned and never align differences it will skew the lines and say there are no differences. How do I get it to see it as two lines that are different?

          Comment


          • #6
            Maybe You are using the sort to compare files?
            So the same lines in different position, after the sorting, appear to be the same?


            Regards

            Rodolfo Giovanninetti



            Comment


            • #7
              See screenshot. Notice line 224 is aligned with 226:Click image for larger version

Name:	Capture.JPG
Views:	3776
Size:	71.5 KB
ID:	81519

              Comment


              • #8
                Try setting Alignment to Unaligned but leave Never align differences unchecked.
                Chris K Scooter Software

                Comment

                Working...
                X
                😀
                🥰
                🤢
                😎
                😡
                👍
                👎