Hi again
Let me expand a bit further on this. Given any file that has a number of .SUBCKT calls I am looking to do a search and replace on the *.pininfo line. This line may extend multiple lines which are denoted by the presence of a + at the start of a line.
.SUBCKT foo a b c *.pininfo vdd:I vss:I a:I b:I c:I vddw:I vddq:O + vddy:I
Now, I want to first get the complete *.pininfo line and then do a replace on certain words. Those words are of two types:
  • Powers which is a comma separated list held by the $runset{"POWER-NODE"}. This comma separated list first needs to to be split up, and at the end of each word get :P concatonated to it
    $runset{"POWER-NODE"}="vdd,vddq,vcc" # translates to vdd:P vddq:P vcc:P
  • Ground which is also a comma separated list held by the $runset{"GROUND-NODE"}. This comma separated also need to be split and concatonated with :G
    $runset{"GROUND-NODE"}="vss,vsc" # translates to vss:G vsc:G
  • Now using the *.pininfo line look for the variables held by both $runset{"POWER-NODE"} and $runset{"GROUND-NODE"} and do a search and replace. The tricky part is dealing with the :P/G/I/O. Effectively, we are ingnoring it during the search but replacing it after the fact. So, given the above example you would end up with a new *.pininfo which looks like..
    .SUBCKT foo a b c *.pininfo vdd:P vss:G a:I b:I c:I vddw:I vddq:P + vddy:I
    Does this help?? Thanks so much

    In reply to Re: Search and replace.. ..a bit different by Rhodium
    in thread Search and replace.. ..a bit different by Rhodium

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.