How do I set two different words to be equal in beyond compare 3 - beyondcompare3

I'm trying to diff different versions of a program. The older version uses 1 and 0 to represent true and false while the new version uses the words true and false. Since these boolean values are everywhere, most of the file is 'different.' For now I've added 1,0,false,and true to unimportant in a custom file type, but this has a few unfortunate side effects (like not matching a 1 that changed to false.) So, does anyone know how to make true match to 1 and false to 0?
edit:
The language is a proprietary one for my company, but it's relatable to sql. An example of what I mean would be
select *
from fake_table ft
where ft.active_ind = 1
becomes
select *
from fake_table ft
where ft.active_ind = true

If you have a Beyond Compare 3 or 4 Pro license, you can use Replacements in the Text Compare to show the differences as a match. Replacements are a pro only feature, if you have a BC3 or BC4 Standard license, then you'll have to use unimportant text.
In the Text Compare, click the Rules toolbar button (referee icon).
Go to the Replacements tab. Click New (BC3) or + (BC4).
Text to find: 1
Replace with: True
After you define the replacements, 1 on the left matched with True on the right will be colored as a match if View > Ignore Unimportant Differences is on.

Related

Is there any way to move the negative to the left side on DataPrep?

I have this DataFrame which was exported from SAP, and it comes with the negative numbers like these
a b c
0 1 2- 3-
1 4- 5 6
2 7 8- 9-
Is there any way to move the (-) sign to the left side on Google Cloud DataPrep?
Few ways of doing that, let's cover a simple one -
Using find-replace transformation, with grouping :
{number} is Trifacta pattern for any kind of number (int\dec)
({number}) saves this pattern as "group 1", later reference at the "replace" field.
We're just deleting the suffix "-", and adding one of our own at the beginning.
Notice that by "trying to find the minus suffix" we're making sure we're not adding a minus where it's not needed.

Specify insert order for fragments

In P4Merge, if I select multiple colored icons in the right-hand pane while holding SHIFT (the blue icon corresponds to 'theirs' file, yellow - to 'base' and green - to 'mine'), all the corresponding fragments are inserted into the result:
But, the order of the insertion seems to be constant: first 'base', then 'theirs', and finally 'mine'. The order in which I select the icons doesn't affect the result.
Can I somehow change this insertion order? (Save for editing the result by hand, of course.) E.g. I'd like to insert 'theirs' fragment after 'mine'.
The tool version here is P4Merge/NTX86/2012.1/475402 .
No, this is not configurable. Copying+pasting is the best workaround.

IF statement with Condtional Formating Crystal

I want to do an IF statement that has 2 outcomes:
I want it to say a word
I want it to be a color
For example:
IF {Command.Check in/Appt} < 0
THEN "Early" AND crGreen
ELSE "LATE" AND crRed
In the above example the AND does not work.
A Boolean is required here.
So I just need to find a way to have those 2 outcomes
Short of using shared variables, you can't do that. One formula, one output.
But there's nothing saying you can't have two nearly identical formulas, (One for Early/Late, one for Red/Green) - And in Crystal, that's the best way to do it. (Glad to see you figured that out on your own.)
The reason the AND keyword was giving you trouble is because AND is a Boolean operator. Whenever you use AND, you're basically using this function:
Take booleans FOO and BAR as input.
I return true if, and only if, FOO and BAR are both true.
If at least one of them is false, I return false.
So the AND keyword was expecting two booleans for input. Instead you gave it a string and a color. Ask a machine if the color Red is equal to true, it's going to complain.
Ok, while I didn't find a solution by adding it in the formula, I did find a solution.
For those who have the same problem, just keep the IF statement:
IF {Command.Check in/Appt} < 0
THEN "Early"
ELSE "LATE"
Then save and go to Format > Highlight Expert to enter the formatting conditions you like.
In the above case, I did:
New > Value of: this field is equal to "Early" Font color Green
New > Value of: this field is equal to "Late" Font color Red

Ignoring date column in beyond compare file comparison

I'm using BeyondCompare3 i've two files with lines containing with this kind of format.
abc,bbbb,cdef,test,14:45:23.123,info,comment
I want to omit the date from the comparison.
I've selected Session > Session Settings > Importance Tab > Edit Grammar button and created a new rule.
After entering an Element name, I've selected Category of Basic, checked Regular Expression and searching for Text.
[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,3}. I've also tried /[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,3}/.
I then click 'ignore unimportant differences' on the tool bar.
I was hoping this would ignore the date column in the comparison. But it doesn't.
Any pointers on this or other tools/scripts would be very much appreciated.
John.
In Beyond Compare 4.1.9, you can ignore Modified Date by unchecking "Compare timestamps" in tab "Comparison" of the "Rules" window.
You can also add a regular expression to define text to be ignored (Unimportant text) in the Rules section like so:
https://www.scootersoftware.com/vbulletin/forum/beyond-compare-2-discussion/beyond-help/2292-set-to-ignore-date-and-timestamp-difference
In a 'Table Compare' session, comparing both files do the following:
Select rules, tab columns;
Edit the date column;
Check the unimportant checkbox;
Enable minor (to ignore minor and unimportant differences);
A date tolerance is also an option, but that is not your question.

ignore differences in syntax in beyondcompare

In a branch of code I have changed all of the code from obj.varname to obj("varname") and when I compare the code I would like to ignore these differences since varname is the same.
I have a regular expression that I think I need but unfortunately can't get the comparison to be ignored using Beyond Compare from Scooter
^obj\("\w*"\)|obj\.\w*$
I am following this tutorial http://www.scootersoftware.com/support.php?zz=kb_unimportantv3
So my question: is this even possible with beyond compare? If yes, please share a solution including either instructions or post your screenshots.
Beyond Compare 3's Professional edition supports this through its Text Replacements feature. If you've already purchased a Standard edition license you need to revert to trial mode to test it: http://www.scootersoftware.com/suppo...?zz=kb_evalpro
Load your two files in the Text Compare.
Open the Session Settings dialog from the the Session menu, and on the Replacements tab click New to create a new replacement.
In the Text to find edit, use (\w+)\.(\w+)
In the Replace with edit, use $1("$2")
Check the Regular expression checkbox.
The alternative would be to mark any instance of obj.varname and obj("varname") as unimportant. The basic steps would be this:
Load your two files in the Text Compare.
Open the Session Settings dialog from the Session menu, and on the Importance tab click the Edit Grammar... button.
In the next dialog click the New... button below the top listbox.
Change the Element name field to something useful (say, "PropertyAccess").
Change the Category* to List.
In the Text in list* edit, add these two lines:
obj.varname
obj("varname")
Click OK to close the Grammar Item dialog and then click OK again to close the Text Format* grammar item.
Uncheck "PropertyAccess" (or whatever you named it) in the Grammar elements listbox in the Session Settings dialog, then click OK to close it.
This approach isn't as flexible or clean. In the steps above you're matching specific, hardcoded object and variable names, so obj.varname is unimportant but obj.othervar isn't, even if it's aligned against obj("othervar"). If text on both sides is unimportant the difference will be unimportant; if one side is important it will be an important difference. So, with the above steps, obj.varname and obj("varname") will be unimportant everywhere, but it will work correctly since they'll either be matched to other cases that also match those definitions (and thus unimportant) or will be matched to something else that doesn't match that definition, which will be important and will make the difference important.
You can use regular expressions to match more general text categories, but you probably don't want to. For example, if you wanted to match all text that followed that pattern you could use these two lines instead:
\w+\.\w+
\w+\("\w+"\)
And then check the Regular expressions checkbox in the Grammar Item dialog so they're matched that way.
The upside/downside to that is that any text that matches those patterns is then unimportant. abc.newvar vs. def.varname would be considered an unimportant difference because both sides match the unimportant definition. That's good for things like comments or whitespace changes, but probably isn't what you want to do here.