No announcement yet.

Folder comparison with ignored strings in html files

  • Filter
  • Time
  • Show
Clear All
new posts

  • Folder comparison with ignored strings in html files

    Newbie alert.

    I am trying to do a compare across two folders with ~1700 files. The newer set of these files (all?) have two changes I want to ignore:
    a footer DIV that I want to ignore, as well as a
    • a footer DIV
    • TD tags with a new width value

    I created a new File Format with Grammar rules that exclude the DIV (String=Text from <div id="footer"> to </div>) and the resized cell (String-Text from <td width= " to ">. These work when I open the compare window and run an instantiate a session. I don't want to do this for all 1700 files. How do I make this work?

    I watched a video on ignoring unimportant text ( but that is at the file level ... I see no way to institute the "unimportant" rule in folders.

    I am sure this is easy, but as a newb ... yeah, not so much. I'd really appreciate a little help/insight.

  • #2

    Yes, to use these results on the folder level, you would want to go to the Session menu -> Session Settings, Comparison tab, and leave Timestamp, Size, and Override enabled. Then also enabled the Rules-based content scan, which is similar to double clicking every file pair automatically.

    The rules-based scan uses the default values, so you will want to go to the Home screen, and in the Saved Sessions list, expand the Edit session defaults folder (or New folder in BC4), and select the Text Compare, and uncheck the DIV format you created to make it unimportant by default.
    Aaron P Scooter Software


    • #3
      Trying ... not getting it

      Hi, thanks for the quick response. I've tried using your suggestions but am not "getting it". I tried following what you wrote but it doesn't work verbatim, so this is what I've done.
      1. From my saved Session, created a new Folder compare. Text won't let me choose the entire directory.
      Click image for larger version

Name:	BC_new1.png
Views:	1
Size:	68.4 KB
ID:	76323
      2. Enabled the expressions created to exclude the DIV and TD. I also tried it unchecked.
      Click image for larger version

Name:	BC_new2.PNG
Views:	1
Size:	60.4 KB
ID:	76324
      3. Got this result (no different than normal)
      Click image for larger version

Name:	BC_new3.PNG
Views:	1
Size:	77.7 KB
ID:	76325
      4. Tried using the Filters drop down ...

      Thoughts? What am I doing wrong?


      • #4

        The Session Settings you found to include the whole File Format name isn't quite the right place. No worries.
        That section is to control which entire file formats are usable by that Folder Compare.

        The section I recommend navigating to is in the Folder Compare's Comparison tab (not the Misc tab as in the screenshot). If you have already loaded the session, you can find these same settings in the Session menu -> Session Settings -> Comparison tab. If edited, you can then use the Session menu -> Save Session to save the updates to the session settings.
        In this comparison tab, you'll find a few items already checked by default: Timestamp, Size, and Override quick test results. Also enable Rules-based comparison in this tab. Then load the session. You should note the center column now populates with an icon representing the content scan of the files.

        Click image for larger version

Name:	RulesBased.png
Views:	1
Size:	33.3 KB
ID:	76327
        Aaron P Scooter Software


        • #5

          Okay, I did that and saved the Session. I opened the New>Text Compare item and deselected my two rules.
          Click image for larger version

Name:	bc_new4.PNG
Views:	1
Size:	61.3 KB
ID:	76328
          Being unsure what to do next I tried the Open button...
          Click image for larger version

Name:	bc_new5.PNG
Views:	1
Size:	69.4 KB
ID:	76329
          and the Text Compare icon
          Click image for larger version

Name:	bc_new6.PNG
Views:	1
Size:	68.6 KB
ID:	76330

          Each time I dropped the folders with the files I need to compare and I get the same results. Obviously I am doing something wrong but I have no idea what.

          I even tried just double-clicking on the Text Compare item in the Home screen (as the rules are saved) and opened two individual files ... The exclusion is not recognized.
          Click image for larger version

Name:	bc_new7.PNG
Views:	1
Size:	55.5 KB
ID:	76331

          Can you point me in the right direction? Sorry to be a bother.


          • #6
            The default Text Compare looks to be configured correctly, as the unchecked items are unimportant. And the Rules-based scan is running, and determining that your files should be different.

            If you open your Folder Compare in the 3rd screenshot, and double click on a pair of aligned files that return as different/red, what difference is displayed in the resulting child Text Compare view?
            The goal is to have the defaults configured in such a way that the files are immediately 'unimportant'. If there are any red differences, we would need to determine why. My first hunch here:
            Your files are HTML. But are your new grammar elements part of the HTML File Format? You would need to have DIV-Excl and other customizations defined as part of the Tools menu -> File Formats, HTML format, as that's the format being used automatically for your *.html files. Otherwise, create a new Text format, assigned for *.html, and customize it with the grammars you need. The detected file extension (*.html) is what determines which format is used, and which format is used determines the list of Grammar elements it has access to.
            Aaron P Scooter Software


            • #7
              That did it ... make the changes in HTML. Thanks!

              Much appreciated!