Sunday, October 7, 2012

INST & LOC Codes Honor Wildcards When Searching

imageThe Footprint_Lookup database, as well as the _Termprops, and _Pinlist tables all use wildcards. But did you know you can use wildcards when referencing the Installation and Location Codes? This is actually quite useful information and will give you a new level of control with reporting.

For example, I marked all components on the machine with a Location Code of MACHINE. I can easily create a BOM of all components used on the machine by putting MACHINE in the Location Code when running the report.

However how to I generate a report of all components that are NOT on the machine? Well one way would be to enter ALL the Location Codes used in the project separated by comas (excluding MACHINE of course). OR simply enter ~MACHINE.

The wildcard ~ as a prefix means "not MACHINE." So this will give the same report as the one listed above but is a much better method. Easier and much cleaner!

Now lets add to the scenario by adding several machines. I now have MACHINE1, MACHINE2, and MACHINE3 in my project. Using wildcards I can easily and quickly report all components used on all machines by using the code MACHINE#. The wildcard # will match any single numeric digit in its place.



So what all wildcards are there? Here's the list.
# (pound)  -  Matches any single numeric digit
@ (at)  -  Matches any single alphabetic character
. (period)  -  Matches any single non alphanumeric character
* (asterisk)  -  Matches any character sequence, including empty ones, and it can be used anywhere: beginning, middle, or end.
? (question mark)  -  Matches any single character.
~ (tilde)  -  If it is the first character in a pattern, it matches anything except the pattern.
[...]  -  Matches any one of the characters enclosed.
[~...]  -  Matches any one of the characters not enclosed.
- (hyphen)  -  Used inside brackets to specify a range for a single character.
, (comma)  -  Separates two patterns
` (reverse quote)  -  Escapes special characters

The last one, ` (reverse quote), would be necessary had I named the machines location MACHINE#1, MACHINE#2, and MACHINE#3. When reporting Electrical will see the # in MACHINE#1 and try to fill it with a number. So when sorting be sure to add the reverse quote like this... MACHINE`#1. Or for our example above, we wanted all machines the code would be MACHINE`##.


  1. Sorry, but I don't understand this two lines:
    [...] - Matches any one of the characters enclosed.
    [...] - Matches any one of the characters not enclosed.
    Could you explain it, please?

    1. Sorry for the confusion. The blog post is now correct. I think it will make sense for you now.