Could you please let me know if there is any way to trim a string in SKILL? e.g. Given string is ABCDEFG, MNOPEFG, IJKLEFG, WXYZEFG I want ABCD, MNOP, IJKL, WXYZ and trim out EFG from the above. Any suggestions...............
It's not clear to me what the criterion is for trimming the string.My guess is that you want to do something like this:rexCompile("EFG$") ; pattern meaning EFG at end of string ($ means end of string)rexReplace("ABCDEFG" "" 1) ; replace first occurrence of pattern with blank.Essentially, the rex functions are regular expressions.Alternatively, if criterion is positional (the first four characters), then itwould be:substring("ABCDEFG" 1 4)Regards,Andrew.
Thanks Andrew!Actually, the need is like this:I've a big design, the leaf cells of which are pointing to some standard library. I want to change the leaf cells to new standard library. The cell names of the old library are ABCD1T10. The cell names of the new library are ABCD.Is there any existing SKILL routing which changes the library name and cell name?The ABCD in the above can be of any number of characters and not necessarily equal to four characters. However, the 1T10 will remain constant.Any suggestions?????
Well, the substitution in that case can be done exactly as I described in my previous example - use rexCompile("1T10$") to compile the pattern, and then rexReplace(cellName "" 1) to get the new cellname.If you have a cellView which has instances from the original library, with the original names, then you'll need to do something like this (this is untested, off-the-top-of-my-head code, just to illustrate the approach); expects variables cv to be current cellView, origLibName the name; of the original library, newLibName the new libraryrexCompile("1T10$")foreach(instHeader cv~>instHeaders when(instHeader~>libName==origLibName && rexExecute(instHeader~>cellName) newCellName=rexReplace(instHeader~>cellName "" 1) dbSetInstHeaderMasterName(instHeader newLibName newCellName instHeader~>viewName) ))Regards,Andrew.
Sorry, the indentation got swallowed in my post - apologies for the badly formatted SKILL code.Regards,Andrew.