No announcement yet.

Beginners question: bc3 doesn't align properly

  • Filter
  • Time
  • Show
Clear All
new posts

  • Beginners question: bc3 doesn't align properly

    Hi - sorry for this "beginner" question
    I am aligning two .txt files by line


    line2:bba (extra)

    The result I am getting:
    aaa - aaa
    bbb - bba (wrongly aligned)
    - bbb (wrongly by itself)
    bbc - bbc
    bbd - bbd

    Obviously bc3 is looking for an initial match per line (bb...) and then aligns right away, besides the fact that there is a better match in the next line.

    a) is there a way to set the criteria to be more strict in general?
    b) could I define that the first 5 or 10 characters per line (at the beginning of the line!) have to be 100% identical to get an alignement, otherwise it should be isolated lines as result (respectively: check the following lines for the exact match).
    Thanks for you help, Heike

  • #2
    When I create text files with the contents you specify above, they align correctly. Try enabling visible white space to see if there are additional whitespace characters that are causing the text to mis-align.

    In answer to your question, however: Yes, you can tweak the alignment rules as follows:

    Click on Session Settings (Referree icon)
    Select the Alignment tab

    There is a slider that can be used to tell BC3 to perform a more thorough alignment... and there is an "Alternate Method" of alignment that can be done.

    The standard method is a top-down algorythm that allows compares to open up in the editor earlier so that the user can work with a file before the alignment has completed.

    The alternate method compares from both ends (top down and bottom up) and can improve alignments in some types of file formats.
    BC v4.0.7 build 19761


    • #3
      Michael's suggestions are a great start. It is likely you just need to tweak your Alignment options and check things like whitespace. If you need help with specific files, you can email [email protected] a pair of example files and your Support package (Help menu -> Support; Export).

      If you need 100%, you can also turn on the Never Align Differences option. If you need to limit it, you can define a grammar element in your File Format to be the first 10 columns, and mark Everything Else as unimportant in your Session Settings.
      Aaron P Scooter Software


      • #4
        Aaron, Michael,
        thank you for the help.
        The example I used is an easy one (it aligns correctly, that is right) - I have large files where the beginning of the line is +/- equal but the rest of the line is different and would never match - I need to align lines that are identical or almost identical in the first 10-20 characters, I don't care about the rest of the line.

        Aaron: your suggestion
        "If you need to limit it, you can define a grammar element in your File Format to be the first 10 columns, and mark Everything Else as unimportant in your Session Settings." --> how would I do this exactly - can you give me an example/guideline? Does this refer to characters or columns?



        • #5
          Tools menu -> File Format -> pick specific format -> Grammar tab.

          Define a new grammar element as Columns 1-10. Give it a name like "Columns1to10", not "New Element".

          Next, open a new compare, and go to the Session menu -> Session Settings -> Importance tab. Make sure Columns1to10 is checked, and "Everything Else" is unchecked. This marks all text that isn't defined as Columns1to10 as Unimportant (blue) differences. These can be hidden or shown with the Ignore Unimportant Differences toggle.

          In the Alignment tab, there is a Never Align Differences option, which should then align on the Important text (columns 1 - 10).

          If you would like you can send your support package (Help menu -> Support; export), a pair of example files, and a screenshot to [email protected] and we can help with the compare.
          Aaron P Scooter Software