Skip to main content
1-Visitor
January 28, 2014
Question

Use compare_file function using a batch file on windows

  • January 28, 2014
  • 4 replies
  • 1283 views

Hi all ,


I am new to Arbortext Editor.


I have a requirement in which .


I batch file should open two file in comparemode where one is the latest version in read/write mode and other is the last version in the read only mode .


for example:


I Have two files for example C:/testA/a.xml (Latest version ) and C:/testB/a.xml (previous version)


These files content may be same or different


I need to write a .bat file which opens the compare result of both the above file.


There is a Compare_files() method .


But i don't know exactly how to use this .


I tried in below way:


editor -c compare_files("testA/a.xml", "/testB/a.xml")


But it dont work


    4 replies

    1-Visitor
    January 28, 2014
    You may have more success placing your commands along with additional logic
    into an ACL file that you load on Editor startup. Something like:

    editor -C1 "source compare_a_to_b_and_open_diff_file.acl"


    1-Visitor
    January 28, 2014
    We do this all the time using .NET or Java, but ultimately it's just
    calling an ACL command. If you're able to work in either language, I
    could send some examples.

    compare_files should take in three arguments: Source File, Mod File, Out
    File. The command, if run using Eval, returns -1 on error, 0 if they're
    the same, and 1 if they're different. I don't remember offhand if the
    outfile is generated if they are identical, but that might be another
    option to check for as well.

    - keith


    1-Visitor
    January 28, 2014

    thanks for your reply


    Yes my project uses .Net to open the single xml files in editor.


    i have to do using .Net (C#) only


    plese send some examples it will be really helpfull for me

    1-Visitor
    January 28, 2014
    Ok, then in that case, you can just do it in .NET

    Epic.AclClass app = new Epic.AclClass();
    app.Execute("set diffencltype=tag"); // Tags are easier to deal with than
    PI's IMO
    int aclResult = Convert.ToInt32(app.Eval("compare_files(" + srcFileName +
    "," + modFileName + "," + outFileName + ")");

    if (aclResult == 1)... etc etc