Announcement

Collapse
No announcement yet.

Session "ignore importance" not working when running as script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Session "ignore importance" not working when running as script

    Folks,
    I want to do a folder comparison, and get all of the diffs for all files in the two folders.
    I've edited a grammar to define some new variables I want to IGNORE when doing a file comparison.
    When I do this using the GUI, all works well -- the three strings are ignored in the comparisons.
    When running via command line, they are NOT ignored.

    I opened the table compare, set the importance to ignore these strings, and said "update for all files in the parent session".
    I opened the folder comparison session, and saved that.

    When I run via the command line, those strings are NOT being ignored:
    Here is the command line:
    bcomp.com @"....myscript.txt" "mySessionName" "....Folder1" "...Folder2"

    Here is the script I am using:
    ================================================== ======================
    log verbose append:"...\My Log %date%.txt"

    # Compare the text contents of the files.
    criteria rules-based

    # Only compare XML files
    filter "*.xml"

    #Load the Session
    #load "%1"

    #Load the now and src directories
    load "%2" "%3"

    #to compare ALL files in the folders add expand all, select all.files
    expand all
    select all.files

    text-report layout:side-by-side options:ignore-unimportant,display-mismatches &
    output-to:"....\testreport.html" output-options:html-color
    ================================================== ==============================

    Any ideas?

  • #2
    Hello,

    Script runs the commands sequentially, so loading your session will then override the previously set criteria and filter lines. My suggestion would be to load the session in the graphical interface and use the Session Settings to manually set the comparison to Rules-based and filter to *.xml, so these settings can be loaded in the same line as loading the session and won't need to be defined in script. Otherwise, you can define them after loading the session name, and before loading the folders into the session.

    The other thing to double check is if the session or default settings apply the unimportance by default. To check this, load the interface, load your saved "mySessionName" and double click a file. Is the text blue or black (Ignore Unimportant enabled) without altering any settings? If not, go to the child text compare's Session Settings, Importance tab, uncheck the grammar name, and before clicking ok update the bottom dropdown from "Use only for this view" to either "Use for all files in parent session" or "Also update session defaults". Once updated, does this help get your script working as expected?

    Also, it looks like the report is intended to only show mismatches, but previously selects all files for generation. If the rules-based criteria is applied, you could update the script to select only the files that contain differences ("select all.newer.files all.older.files all.different.files all.orphan.files"); something you could consider once the report is correctly reporting the differences you expect.
    Aaron P Scooter Software

    Comment


    • #3
      Originally posted by Aaron View Post
      Hello,

      Script runs the commands sequentially, so loading your session will then override the previously set criteria and filter lines. My suggestion would be to load the session in the graphical interface and use the Session Settings to manually set the comparison to Rules-based and filter to *.xml, so these settings can be loaded in the same line as loading the session and won't need to be defined in script. Otherwise, you can define them after loading the session name, and before loading the folders into the session.
      So I changed the script to:
      #Load the Session
      #load "%1"
      # Compare the text contents of the files.
      criteria rules-based

      # Only compare Informatica XML files
      filter "*.xml"



      The other thing to double check is if the session or default settings apply the unimportance by default. To check this, load the interface, load your saved "mySessionName" and double click a file. Is the text blue or black (Ignore Unimportant enabled) without altering any settings? If not, go to the child text compare's Session Settings, Importance tab, uncheck the grammar name, and before clicking ok update the bottom dropdown from "Use only for this view" to either "Use for all files in parent session" or "Also update session defaults". Once updated, does this help get your script working as expected?
      So I loaded the session, then clicked on a file to do the comparison, and it correctly ignored the vars I had set(this was from a fresh restart of the GUI). SEEMS like this has the grammar/importance set correctly.

      Also, it looks like the report is intended to only show mismatches, but previously selects all files for generation. If the rules-based criteria is applied, you could update the script to select only the files that contain differences ("select all.newer.files all.older.files all.different.files all.orphan.files"); something you could consider once the report is correctly reporting the differences you expect.
      I think the change to the script seems to have done the work!!! Now getting those ignored instead of showing up.
      THANKS for this!

      I do only want to see the differences for all files in the given folders --- thanks for the tip.

      Comment

      Working...
      X