Announcement

Collapse
No announcement yet.

462 How to specify unimportant strings?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • 462 How to specify unimportant strings?

    How for the current text compare session may I specify unimportant text strings? E.g. characters past the last ';' or anything inside [...], such that they will be ignored by "Ignore unimportant differences".

    The Help index entry "Unimportant text" goes to a topic that doesn't mention unimportant text. There's no index entry for "Ignore unimportant differences". The topic "Text Compare Importance" doesn't say how to specify unimportant strings.

  • #2
    Chris,

    Here's an example for BC3 build 462.

    In the example ; to end of line is comment that will be treated as unimportant text.

    In the Text Compare, select Session > Session Settings.
    Go to the Importance tab.
    Click the "Edit Grammar..." button.
    Click New and name the grammar "Comment".
    Select "Delimited" as the category.
    Text from: ";".
    Check "Stop at end of line" and click OK until you're back to the "Importance" tab in Session Settings.
    Leave "Comment" unchecked to treat it as unimportant, then click OK to return to the main window.
    Chris K Scooter Software

    Comment


    • #3
      > Leave "Comment" unchecked to treat it as unimportant,

      Thanks. Out of interest, how is the regular user expected to discover that secret feature?

      > Select "Delimited" as the category.
      > Text from: ";".

      For the record, that matched from the first ';' rather than the last. I found match from last could be achieved by Basic with regexp ;[^;]*$.

      Aslo, some of the user overhead of this new need to define an "element" to set unimportant text could be alleviated by allowing edit by double-click of an items on 'Grammer elements'.

      Comment


      • #4
        Originally posted by chrisjj
        Aslo, some of the user overhead of this new need to define an "element" to set unimportant text could be alleviated by allowing edit by double-click of an items on 'Grammer elements'.
        Unfortunately, this won't work because there can be multiple grammar items with the same grammar element.
        Erik Scooter Software

        Comment


        • #5
          Originally posted by Chris
          Chris,

          Here's an example for BC3 build 462.

          In the example ; to end of line is comment that will be treated as unimportant text.

          In the Text Compare, select Session > Session Settings.
          Go to the Importance tab.
          Click the "Edit Grammar..." button.
          Click New and name the grammar "Comment".
          Select "Delimited" as the category.
          Text from: ";".
          Check "Stop at end of line" and click OK until you're back to the "Importance" tab in Session Settings.
          Leave "Comment" unchecked to treat it as unimportant, then click OK to return to the main window.
          That didn't quite work for me in XML documents I'm comparing, but here's what did for ignoring particular tags - following the directions above with this change:

          I entered the opening tag (without quote marks) in the Text from: field
          I entered the closing tag in the to: field (also without quote marks)

          I thought I could use the instructions above by just substituting the opening tag in quotes, but for some reason, it didn't work.

          Anyway, thanks for this tip!

          Comment

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