Rules set up by Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Neha
    Visitor
    • Aug 2018
    • 9

    Rules set up by Script

    Hi,

    Can You give me a solution for that how can I set up Rules by script ?

    Here this my script :-
    BCompare.exe /silent @"C:\Test\TEmp\Formate.txt" "C:\Test\TEmp\LeftFile.txt" "C:\Test\TEmp\RightFile.txt" "C:\Test\TEmp\Result.html"

    In Formate.txt script :-

    criteria rules-based
    filter "*.txt;"
    file-report layout:side-by-side options:display-mismatches,ignore-unimportant output-to:%3 &
    output-options:html-color,wrap-word %1 %2

    LeftFile.txt and RightFile.txt which I need to compare and Result.html which is my output file

    Here I want to Set up rules for Unimportant text like :- "Cents:\s\d{2,3}"
    so how can I set up that(Unimportant text) by script ?

    Thanks In Advance!
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #2
    Hello,

    Unimportance or grammars cannot be defined in script. If you set the Unimportance in the graphical interface first, and define it to be the default behavior, then that will be used in script. We have a guide for defining unimportance here:
    http://www.scootersoftware.com/suppo..._unimportantv3

    If you perform the edits to default behavior, you can also note how this updates the BCSessions.xml, and perform those edits manually in another automated solution, altering a BC4 Portable Install before calling it for scripting.
    Aaron P Scooter Software

    Comment

    • Neha
      Visitor
      • Aug 2018
      • 9

      #3
      Hi,

      Thanks for your prompt reply.
      So as far as I understand from your reply, If we have requirement to pass special REGEX to BC.exe It can be passed thru BCSession.xml.

      Can I edit it and pass it thru Command line.

      Because we have specific requirement that we will get REGEX input from user and then we need to display result based on that filter criteria.

      Thanks

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16000

        #4
        Hello,

        You would have to edit it manually before calling to BCompare.exe. Essentially, you a 'hacking' our settings outside of the program, but our settings are plain text and easy to alter as long as you use the correct syntax.

        I recommend changing the settings in the graphical interface first. This way you can save a backup copy of BCSessions.xml, open BC4 and add a new Unimportant regex, update defaults, etc, close BC4, and then save a copy of the updated BCSessions.xml. You can then use BC4 to compare the old and new BCSessions.xmls (and other .xmls if altering other settings) to see how they update, to determine the syntax needed for all of our various settings.

        Always back up the current BCsetting.xmls before performing manual edits, as a bad edit can cause them to no longer be loadable.
        Aaron P Scooter Software

        Comment

        • Neha
          Visitor
          • Aug 2018
          • 9

          #5
          Hi,

          Thanks Aron.

          And our requirement is that multiple users can accessed at the same time in web application and they have different scenario for REGEX syntax .
          so can we use another file instead of BCSession.xml ? and if Yes then how we can use another file and load by default when we calling BCompare.exe ?

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16000

            #6
            If different user's are accessing, then you need to be careful which BCsettings.xmls are used and need to be edited. Is each a separate Windows User account and each has their own %AppData% folder with their own settings that can be updated?
            Aaron P Scooter Software

            Comment

            • Neha
              Visitor
              • Aug 2018
              • 9

              #7
              Hi,

              In general scenario our application will be hosted on one server as it is Web Application, and It will be accessible by any authenticated user from browser.


              They will be having their own AppData folder in their machine but not in hosted server. so automatically it(BCsettings.xml) will be saved to their local system or where actual setting has been hosted?

              Comment

              • Chris
                Team Scooter
                • Oct 2007
                • 5538

                #8
                Beyond Compare settings will be stored on the hosted server running Beyond Compare.

                If Beyond Compare is installed for all users, then settings are stored in "%appdata%\scooter software\beyond compare 4" on the hosted server, where %appdata% is based on the user account running Beyond Compare on the server.

                If Beyond Compare is installed as a portable install, then settings XML files are stored in the portable install folder. If you need separate settings for each web user, you can create a separate portable install on the server for each web user.

                Beyond Compare isn't designed to run under a single user account with multiple settings locations for that single user, so there isn't a really clean method to do what you're describing.
                Chris K Scooter Software

                Comment

                • Neha
                  Visitor
                  • Aug 2018
                  • 9

                  #9
                  Hello,

                  In Desktop BC Compare, I am applying Rules(RegEx) on file and the after I am Click on "Minor" then in file for particular text, change to another color.

                  So can you tell me that If I want this change in my local web then how can I apply in BCsession.xml or in my format input file ?


                  Thanks,
                  Neha

                  Comment

                  • Chris
                    Team Scooter
                    • Oct 2007
                    • 5538

                    #10
                    Use the ignore-unimportant option for the criteria command if running a report on a pair of folders or the same option for text-report if running a report on a pair of files.

                    Example report for a pair of folders:

                    criteria rules-based ignore-unimportant
                    load c:\folder1 c:\folder2
                    expand all
                    select orphan.files diff.files
                    text-report layout:side-by-side options:display-mismatches,ignore-unimportant output-to:c:\out.txt output-options:html-color,wrap-word

                    Example report for a pair of files:
                    text-report layout:side-by-side options:display-mismatches,ignore-unimportant output-to:c:\out.txt output-options:html-color,wrap-word file1.txt file2.txt
                    Chris K Scooter Software

                    Comment

                    • Neha
                      Visitor
                      • Aug 2018
                      • 9

                      #11
                      Hi,

                      We have tried to make changes in command line as per your suggestion.
                      But still we are not getting result what we want.

                      For better understanding we have prepared one small video which can be helpful to understand the problem and what output we want with the help of Command line.

                      Also attached screenshot of output which we required and it is covered in video as well.

                      So basically we stuck in a loop that what we need to change in BCSession.xml and Format which we need to pass in command line.
                      Right now we are focusing only for Text file comparison.



                      Thanks!
                      Attached Files

                      Comment

                      • Chris
                        Team Scooter
                        • Oct 2007
                        • 5538

                        #12
                        In scripts, you'll need to either load a saved session or change the default session settings interactively for them to apply to the script. When defining the unimportant text interactively, change the dropdown at the bottom of the dialog from Use for this view only to Also update session defaults before you click OK. After you've applied the session settings to the default Text Compare session, it should affect your script.
                        Chris K Scooter Software

                        Comment

                        • Neha
                          Visitor
                          • Aug 2018
                          • 9

                          #13
                          Hi Chris,

                          Thank You So much for giving a great support from You and Your Team...Now I am able to generate Output as I Want...Thank You So much again.

                          Thanks,
                          Neha

                          Comment

                          Working...