PDA

View Full Version : Align based on first X charaters of line


mike.bitsch
15-Nov-2010, 04:55 PM
I'm trying to compare two files that have memory addresses as the first part of the line (like an Intel Hex formatted file).

The first 9 characters are the address, and I'd like to have Beyond Compare align based on those first 9 characters.

I've tried using a regex like ^\w{9} under alighment, but that doesn't seem to have the desired effect.

I've also tried using the Data Viewer plugin, with the first 9 characters in one column as the key. This works great for the alignment, but marks everything in the second column (the data) as non-matching, even when the data is identical.

Thanks

Michael Bulgrien
16-Nov-2010, 02:26 PM
I've tried using a regex like ^\w{9}

I don't understand what you've tied so far as there is no place for a regular expression under the text compare session settings Alignment tab. What you really want to do is to set up a grammar:

Session -> Session Settings... -> Importance tab
Click the Edit Grammar... button

From here you can create a new regular expression grammar element and mark it as important. If you want more specific instructions, a sample of your data would be helpful.

Aaron
17-Nov-2010, 09:42 AM
In addition to Michael's comments about grammar, you can mark the new grammar type as Important, and Everything Else as unimportant (uncheck it). This will align weighed on your Important (defined grammar of the first column) data.

The Data Compare also sounds like it would work well. If you view the Hex data of your lines (in our Text Compare or Hex Compare), is the rest of the line completely equal? Sometimes with complicated files there may be a difference hidden as non-viewable text. If there is even a single difference within a cell, then the whole cell will be marked as a difference.

If you would like to email us example files instead of posting them to the forum, our email is support@scootersoftware.com. If you email us, please include a link back to this forum post and your Support package (Help menu -> Support; Export). Do not post your support package to the forum.