Announcement

Collapse
No announcement yet.

Grammer Item help with delimeted lines.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Grammer Item help with delimeted lines.

    Hello, I have just started using beyond compare. I am using it to compare a set of files in one folder to another. It is working well but I am trying to refine what is considered an un-important difference, using a grammer item. I can flag an entire line as unimportant, but would like to be able to focus on a specific data element in a specific line. For example, in the line below, I want to ignore any difference in the last data element (the date), but flag differences in any other data elements. How would I write my Grammer Item rule?

    BAK|00|AC|A4094-2|20140130||10|NATIONAL|0001391143|20140530

    Thanks

  • #2
    Hello,

    You would need to define a RegEx to match on the text you specifically want to ignore, for example:
    \|[^|]*$

    Beyond Compare is a multi-platform utility that combines directory compare and file compare functions in one package. Use it to manage source code, keep directories in sync, compare program output, etc.
    Aaron P Scooter Software

    Comment


    • #3
      Thanks for the reply. However, I cannot predict what the text will be. I only know that it will be the in the ninth position of the line starting with "BAK", with each position delimited by "|". Can this line splitting and position targeting be coded in a Regex statement?

      Comment


      • #4
        Hello,

        Not that I'm aware of. A RegEx might be able to find the 9th position of a line, but we wouldn't be able to limit this to only lines that begin with BAK. The only workaround I can think of would be to define something like:
        ^BAK\|[^|]+\|[^|]+\|[^|]+\|[^|]+\|[^|]+\|[^|]+\|
        to match on the first 8 cells if the line begins with BAK, then make another
        ^[^B][^A][^K].*\|[^|]+\|.*
        to match on a line that does not begin with BAK
        Then make these two grammars important, and mark "Everything Else" as Unimportant.

        If you have | delimited data, it might also be easier to sort it in our Data Compare, where we can mark the 8th Column as Unimportant (in all cases, regardless of Bak), just by right clicking the column header, and changing from Standard to Unimportant.
        Aaron P Scooter Software

        Comment

        Working...
        X