Argfile and regex assistance

GaryHampsonGaryHampson Posts: 19
edited February 11, 2005 1:25PM in SQL Compare Previous Versions
Brian,

I've been enjoying using the command line interface of the Compare tool and it has been very helpful thus far, but I am having a little difficulty in the granularity of selecting objects to compare (or not to in this case).

Here is the argfile:
<?xml version="1.0"?>
<commandline>
    <include objecttype="Table"/>
    <exclude objecttype="Table" matches="t_rpt_rcn_"/>
    <exclude objecttype="Table" matches="t_temp_"/>
    <force/>
    <outputwidth>140</outputwidth>
    <snapshot1>\\server1\snapshot1.SNP</snapshot1>
    <snapshot2>\\server2\snapshot2.SNP</snapshot2>
    <out>\\server3\output.txt</out>
    <report>\\server3\report.html</report>
</commandline>

What I would like to do is now exclude all tables that start with "t_str_" with the exception of "t_str_dimension" and t_str_levels". I really don't want to have to explicitly exclude all 49 remaining tables.

Any ideas?

Peace,
Gary Hampson

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    edited February 11, 2005 1:39PM
    Hi Gary,

    Thanks for posting here. You should be able to get away with this rather easily. You can make a regular expression that matches the first part of the table but not the endings that you specify and put that in an exclude tag:
        <exclude objecttype="Table" matches="\[t_str_(?!dimension\]|levels\])"/>
    
  • That is wonderful!! Thanks again Brian.. You are the best!!
This discussion has been closed.