No announcement yet.

Doing a strict comparison of an attribute?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Doing a strict comparison of an attribute?

    I wasn't sure how to word this in the thread title.

    The problem I have right now is that in one of my XML files, there's about 400 records added. When the diff is done, it gets to a point where the diff is just wrong.

    I have elements with an id, so for example
    <element id="000001">

    So when it sees some that are in one file, but not the other, it starts messing up entirely, comparing the trailing numbers. So it will highlight the 1 and compare it with record 000003.

    Can I make it ignore records that are in one file but not the other, and do a strict comparison on the ids, which I know will never be off by a few characters? (Basically compare only whole ids. Not parts of ids.)

  • #2

    Which type of alignment would you say you are having more trouble with? Aligning line by line (so the expected lines match up), or aligning the text within the line (lines are lining up as they should, but the characters within are not aligning as you expect)?

    If it is the line by line alignment, does using one of our tidied or sorted rules help? We have a few XML variants available here:
    These restructure the flow of your XML file, so saving the XML will save the new organization.
    Aaron P Scooter Software


    • #3
      The lines are completely off. It will start comparing unrelated items.

      xml sorted didn't work. Trying xml sorted & tidied now. The files are several million lines long so each run takes a while.
      Last edited by Gibbers; 25-May-2011, 08:30 AM.


      • #4
        It looks like sorted & tidied fixed most of the file. It's still running.
        Last edited by Gibbers; 25-May-2011, 09:03 AM.


        • #5
          How large is your file in filesize and number of lines?
          Aaron P Scooter Software


          • #6
            Both files are about 100mb, and both are around 3.2-3.5 million lines.

            They're xml exports of a database. For some reason, one of them has about 4,000 extra records in a couple of these batches. It's throwing the diffing off by a lot.

            After doing the sort & tidy, it fixed about 1.2 million lines, but the rest of the diff is wrong.


            • #7

              In the Text Compare, Session menu -> Session Settings, Alignment tab, does raising the Skew Tolerance help in this situation? Increasing this value may help when there are large gaps that BC3 must look over (4,000 lines) to find a match. You may want to try with both the regular XML file format, and the sorted and tidied one.
              Aaron P Scooter Software


              • #8
                Looks like that solves the issue. Thanks.


                • #9

                  Please note that Session Settings are session specific. You will need to save this session and use it in the future (like a bookmark), or change the session defaults to use these settings for all future Text Comparisons. To set the default, load up the Home screen, expand the Edit session defaults folder in the saved session list, and select the Text Compare (default). Edit the setting here to apply it as the default for all future text comparisons.
                  Aaron P Scooter Software