2

I want to compare c and XML files with Beyond Compare. But I want to detect if there are differences within a Block to the corrosponding on the other file and if there is a difference in a block I dont want Beyond Compare to Show the difference in the block, but handle it like this block is not in the other file. I Need this because in my files are certain Code blocks which are nearly the same but do have different Signalnames in it.

So for example i got a c file that Looks like this:

//1
functioncall(
    Singalname1,
    Singalname2,
    Singalname3,
    Singalname4,
    Singalname5,
    Singalname6);

//2    
functioncall(
    Singalname31,
    Singalname32,
    Singalname33,
    Singalname34,
    Singalname53,
    Singalname36);

And a second file which Looks like this:

    //1
functioncall(
    Singalname1,
    Singalname2,
    Singalname3,
    Singalname4,
    Singalname5,
    Singalname6);

//2    
functioncall(
    Singalname371,
    Singalname372,
    Singalname373,
    Singalname374,
    Singalname573,
    Singalname376);

If I compare those two files with BeyondCompare it determines the difference within the second function call because the signalnames all contain a 7. But i want Beondcompare compare the whol functioncall an if there are differences in the functionCall to Show the functioncall beside empty space so i can add it eaily to the second file. So not like this: enter image description here I want it like this: enter image description here

I tried to add some comments with a begin comment and an end comment with a incrementing number in it something like this:

    //begin1
functioncall(
    Singalname1,
    Singalname2,
    Singalname3,
    Singalname4,
    Singalname5,
    Singalname6);
//end1    

And then adding a specific rule in beyond compare. Unfortnatly i did not manage to add this rule to beyond compare. Furthermore Ithink the Code is not good with this comments in it.

Loois95
  • 85
  • 12
  • Do you want a way to do it most efficiently in the GUI or programmatically? If programmatically, please show how far you got by making a [mcve] of what gets closest (but still is not what you want). – Yunnosch Jun 12 '19 at 06:14
  • By the way, I think the question is on-topic, because to me this kind of using comparison tools IS very closely related to programming - even if the question is about using the GUI. – Yunnosch Jun 12 '19 at 06:16
  • You seem to have an often-repeated typo "Singal/Signal". Did you notice? It does however not break the question. – Yunnosch Jun 12 '19 at 06:18
  • Hi, thank u for your comment. I want to do it with minimal edtion in Code. I tried to add "orientation comments" but ist kinda inefficent and the Code gets confusing. – Loois95 Jun 12 '19 at 06:18
  • @Yunnosch oh yeah thank you didnt notice this. But it is not important the actual Code Looks way more complexe this is just a simple example to Show the Problem. – Loois95 Jun 12 '19 at 06:19
  • Please show your coding attempts. It is as much about which coding API you use as about the effort you spend and the research results you already have. Otherwise you might end up being considered off-topic for not showing a MCVE - and I really want this question to survive... I itch to start looking for an answer... – Yunnosch Jun 12 '19 at 06:23

2 Answers2

0

Beyond Compare doesn't provide a method to do this. The best workaround is to use the right click Align With command to shift the function alignment.

Chris Kennedy
  • 2,639
  • 12
  • 11
0

Did you try the "Never align differences" checkbox in the Alignment tab of the session settings?

enter image description here

opus131
  • 1,976
  • 1
  • 11
  • 13