Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Clip Using RegEx to Strip ID Information

Expand Messages
  • buralex@gmail.com
    ... H= trim step ^!replace rwasi copy two lines above, in Notetab ... right-click on Clipbar header, (F4 to display it) create new
    Message 1 of 3 , Jan 3, 2007
    • 0 Attachment
      Carolyn:
      > What I want to do is to be able to strip from space id to the end tag for
      > every tag (in this case, I would be left with ). In all cases, the
      > information will be proceeded by "id" in the tag. In every case, no matter
      > how many variables are in between, I would want to strip from the id
      > to the
      > end tag. Can someone walk me through the process of doing a clip and
      > running it on my files for a case such as this).
      > <step id="A00001" vid="1" fvid="1"> ===> <step>
      H="trim step"
      ^!replace "<step .*>" >> "<step>" rwasi

      copy two lines above,
      in Notetab ...
      right-click on Clipbar header, (F4 to display it)
      create new Library (name it myClips), ,
      right-click below header select Add from Clipboard

      above should work in either Notetab 4.x or 5.x (not tested)

      Regards ... Alec -- buralex-gmail
      --



      [Non-text portions of this message have been removed]
    • Alan_C
      On Wednesday 03 January 2007 15:23, Wiles, Carolyn M wrote: ... All below are untested. And, if your tag(s) span lines (tag is not only on one line)
      Message 2 of 3 , Jan 3, 2007
      • 0 Attachment
        On Wednesday 03 January 2007 15:23, Wiles, Carolyn M wrote:
        <snip>
        > Here is an example (it doesn't have to be step, it could be another tag -
        > but the ID information is constantly changing):
        >
        > <step id="A00001" vid="1" fvid="1">
        >
        > What I want to do is to be able to strip from space id to the end tag for
        > every tag (in this case, I would be left with <step>). In all cases, the
        > information will be proceeded by "id" in the tag. In every case, no matter
        > how many variables are in between, I would want to strip from the id to the
        > end tag. Can someone walk me through the process of doing a clip and
        > running it on my files for a case such as this).

        All below are untested. And, if your tag(s) span lines (tag is not only on
        one line) then you need yet even a more complex regex than these.

        The below, SPACEid is *not*much** with which to use as find info (too easy
        to also match in places you don't want it to match?) -- thus, may better to
        use (be more specific) like so:

        "(<step) id.+(>)"

        or

        "(<whichever_tag) id.+(>)"

        Here's some more ideas:

        if is Version 5.1 Notetab:

        ^!Replace "(<.+) id.+(>)" >> "$1$2" RISAW

        if is version 4.95 Notetab:

        ^!Replace "{<.+} id.+{>}" >> "/1/2" RISAW

        but the 4.95 may not work adequately due to the 4.95 regex greed issue.

        --
        Alan.
      Your message has been successfully submitted and would be delivered to recipients shortly.