Go Back   Scooter Forums > Beyond Compare 3 Discussion > Text Compare (2-way)
Register FAQ Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 22-Mar-2012, 02:27 AM
CrazyDef CrazyDef is offline
New User
Join Date: Mar 2012
Posts: 1
Question Matching key/value pairs


I have a large text file with lots of "key : value" entries. These entries are nested to form a tree of sorts. Nesting is achieved through different indentation levels. (So sorting is out.)

I would like to use some of these key/value pairs to realign the comparison between files. Is there anyway I can configure the rules in BC3 to do this? Basically I want to say for "this key", explicitly match values that follow on the same line and give priority to matching these lines first.
Reply With Quote
Old 22-Mar-2012, 09:24 AM
Aaron Aaron is offline
Team Scooter
Join Date: Oct 2007
Location: Madison, WI
Posts: 7,358


We can give priority by adding a line weight to a specific regular expression match ("Key"), but it would not take the indentation into account unless that was also defined as part of the regular expression. Line weights are defined in the Tools menu -> File Format, as part of the file format in the grammar tab.

Depending on your data, it may be easier to pre-process it with your own custom tidying process, so that it is sorted and the matches would more likely align automatically.

You can also try different Alignment options, such as Alternate Alignment in the Text Compare's Session Setting dialog's Alignment tab. Another trick may be to define a Grammar element for the Key, then mark it as Important and Everything Else as Unimportant. Then change the Alignment settings to "Never Align Mismatches", which would then only align based on the defined Important grammar when it matches exactly.
Aaron P Scooter Software
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -6. The time now is 07:37 AM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.