Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Oct 2010
    Posts
    7

    Default Set RegEx filters from script?

    Hi

    I´m using BC 3.0.15 (upgrade might not be an option, it´s a big company) and I need to make 16 different comparisons on different folders and the ignore filters (http://www.scootersoftware.com/suppo...mportantv3.php) are different each time. Is there a way to set (and delete) the filters in the script?

    Example of a filter: tools -> file formats -> grammar:
    Element name: IgnorableElement
    Category: basic
    Text matching: ^PLI......$
    Regular Expression: checked

    There will be 3-4 (different) filters for each comparison.

    Kind regards
    Kim

  2. #2
    Join Date
    Oct 2007
    Location
    Pennsylvania
    Posts
    1,772

    Default

    The quick answer is to set up sessions in the GUI for each of the 16 different computers with the ignore filters set the way you want them then save each of the sessions. In your script, load each session by name to inherit the session settings you set up in the GUI.
    BC v4.0.7 build 19761
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

  3. #3
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Hello,

    Just to clear up a bit of terminology, we generally use the word "filter" for either "file name filters," "misc filters" such as date or Attribute status, or "display filters" which are the buttons in the toolbar for showing only different files. The concept above in your example is the creation of a grammar element for a file format, which can then be marked as "Unimportant text" in the session settings, and ignored using the Ignore Unimportant Differences option.

    If you save a particular Folder Compare session, and want to have the files in it ignore specific Unimportant text, you can set this up. First, in the graphical interface, load your Folder Compare. Then double click on a file to open a child Text Compare session. Go to that child's Session Settings and set your Importance as you wish to ignore it and use the dropdown in the lower left to "Apply for all files in parent session." Then mark the toolbar to Ignore Unimportant Differences. Close the child comparison, mark the Folder Compare's Ignore Unimportant Differences, and re-save the parent Folder Compare.

    You can then repeat this process with a new Folder Compare parent session to save different child session settings. Script can only load Folder Compare sessions.

    The next step depends on what you would like to do next in script. For example, you can load this parent session in script with the load command, issue and expand all command, select files, and run text-reports to see text differences inside of the files. Then load the next folder compare session and repeat.

    How does this work for you? Please let us know if you have any questions. Also, please include or email your current script and we can help set it up. If you email us at support@scootersoftware.com , please also include a link back to this forum post for reference.
    Aaron P Scooter Software

  4. #4
    Join Date
    Oct 2010
    Posts
    7

    Default

    Quote Originally Posted by Aaron View Post
    Hello,
    If you save a particular Folder Compare session, and want to have the files in it ignore specific Unimportant text, you can set this up. First, in the graphical interface, load your Folder Compare. Then double click on a file to open a child Text Compare session. Go to that child's Session Settings and set your Importance as you wish to ignore it and use the dropdown in the lower left to "Apply for all files in parent session." Then mark the toolbar to Ignore Unimportant Differences. Close the child comparison, mark the Folder Compare's Ignore Unimportant Differences, and re-save the parent Folder Compare.
    I´ve tried to follow your suggestion, but it seems that I can´t save the selected file format setting.

    I´m testing with two pdf filters and two sessions at the moment, "do" and "fd". If I open the do session and in the file format settings change the pdf mask to the "do" filter, do all the things you wrote, then save it and do likewise with the "fd" session then when I select the "do" session again "fd" is checked in file format.

    Quote Originally Posted by Aaron View Post
    You can then repeat this process with a new Folder Compare parent session to save different child session settings. Script can only load Folder Compare sessions.
    I´ve come to realize that know and that´s my approach

    Quote Originally Posted by Aaron View Post
    For example, you can load this parent session in script with the load command, issue and expand all command, select files, and run text-reports to see text differences inside of the files. Then load the next folder compare session and repeat.
    That´s what I´m doin´(or trying to)

  5. #5
    Join Date
    Oct 2010
    Posts
    7

    Default

    Quote Originally Posted by Aaron View Post
    Hello,
    ...and re-save the parent Folder Compare.
    By this you mean save the session, right?

    /Kim

  6. #6
    Join Date
    Oct 2010
    Posts
    7

    Default Solved?

    Okay, I´ve done some further testing. When I change the session (to "do")and look at tools -> file formats, the pdf mask is the same (for "fd"), but that might be a global setting, that is overruled by the session settings? Cause I did some more filtering and are getting the results I expect (and under session settings -> importance->edit grammar for the child the filters I expect is there (the ones for "do")

    Thanks for your help Arron.

    Kind regards
    Kim

    Edit 27/10-2010: hmm... Added a new rule to "do", but now this filter is not activated when running "do" session, instead it´s the "fd" filter (that seems to be default, in tools -> file format), so I still have the problem :-/
    Last edited by xeatopdk; 27-Oct-2010 at 03:26 AM. Reason: problem reoccured

  7. #7
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Hello,

    The File Formats dialog under the Tools menu is global, so changing that per session will change it globally. The Session Settings dialog is specific for each session.

    If you make a clone of your File Format (one for session do, and one for session fd), and you have BC3 Pro, there is a session setting in the Misc tab, where you can disable all file formats except a specific one. This way, you can control which is used on a session by session basis.
    http://www.scootersoftware.com/suppo...?zz=kb_evalpro

    Does this help clear up the behavior you are seeing? If you need different file formats for your specific sessions, you will need to create multiple formats. It is also possible you may be able to use a single format with properly defined grammar elements.

    Could you give more specific examples as to how you wish to use grammars and file formats with your files and sessions? You can email them to us at support@scootersoftware.com to keep the conversation private. Please include a link back to this forum post in the email.
    Aaron P Scooter Software

  8. #8
    Join Date
    Oct 2010
    Posts
    7

    Default

    Quote Originally Posted by Aaron View Post
    The File Formats dialog under the Tools menu is global, so changing that per session will change it globally. The Session Settings dialog is specific for each session.
    Changing session will not change it globally for me. "fd" pdf filter is selected, when I then select the "do" session the pdf filter is still "fd" in tools -> file formats, but when running the folder comparison the "do" filter is used for the "do" session. The most annoying thing now is that I have to aactive select the "do" filter when I wanna make a new rule to the "do" filter, cause "fd" filter is default selected in tools -> file formats

    Quote Originally Posted by Aaron View Post
    If you make a clone of your File Format (one for session do, and one for session fd), and you have BC3 Pro, there is a session setting in the Misc tab, where you can disable all file formats except a specific one. This way, you can control which is used on a session by session basis.
    http://www.scootersoftware.com/suppo...?zz=kb_evalpro
    I guess we don´t have the pro version here, and it´s not possible to test the pro version on the company PC (It politics)

    Quote Originally Posted by Aaron View Post
    Does this help clear up the behavior you are seeing? If you need different file formats for your specific sessions, you will need to create multiple formats. It is also possible you may be able to use a single format with properly defined grammar elements.
    I´ve created several different formats for the same pdf mask. The RegExs are too different and specific for each type of document so it´s not an option with only one filter (lines might be acceptable to ignore in one document, but not in anoter)

    Quote Originally Posted by Aaron View Post
    Could you give more specific examples as to how you wish to use grammars and file formats with your files and sessions? You can email them to us at support@scootersoftware.com to keep the conversation private. Please include a link back to this forum post in the email.
    I´ve mailed you an export of my settings, sessions and filters.

    Kind regards.
    Kim

  9. #9
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Quote Originally Posted by xeatopdk View Post
    Changing session will not change it globally for me. "fd" pdf filter is selected, when I then select the "do" session the pdf filter is still "fd" in tools -> file formats, but when running the folder comparison the "do" filter is used for the "do" session. The most annoying thing now is that I have to aactive select the "do" filter when I wanna make a new rule to the "do" filter, cause "fd" filter is default selected in tools -> file formats
    Sorry for the confusion. To clarify, if you open a session, and then go to the Tools menu -> File Formats, you are entering a global settings area. Any changes here will affect the entire program, similar to going to the Tools menu -> Options and changing a difference color. It will be different for the current session, and any other sessions you may open later. The way a file format is selected by default is the topmost file format that matches based on extension is used automatically. To override this behavior requires a bit of pre-configuration and setup.

    Filters (Name Filter and Other Filter, in the Session Settings dialog) are Session Settings, and will save based on the session you are loading or your default session settings when opening a new session.

    What kind of sessions are you using? Folder Compare sessions with file comparisons run as child sessions or are you saving directly as a few different Text Compare sessions.

    Looking through our support@scootersoftware.com inbox, I do not see an email from you, and it does not appear it was blocked by our spam security. It may have been blocked on your end; please try sending us an email without an attachment first to see if that can get through. Please include a link back to this forum post in the email so we can link the two cases together.
    Aaron P Scooter Software

  10. #10
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    In addition, this video may help:
    http://www.scootersoftware.com/videos/WN3Options.html
    Aaron P Scooter Software

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •