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

Re: [Clip] Testing Conditions?

Expand Messages
  • hsavage
    ... it is in ... it is ... which is ... SWIC ... (probably ... Phillip, In your examples, ^!IfTrue ^!Find ILDED ^!Set %DRES%=ILDED, there are 3 clip commands
    Message 1 of 11 , Jun 9, 2006
      Phillip Sand Hansel II wrote:
      > Greetings:
      >
      > I am trying to find out if a word is in a file I am editing, and if
      it is in
      > there, change another variable based on the first one's existence. If
      it is
      > not there, I want to see if perhaps the next item is there, etc...
      >
      > I am trying to say, "change the generic curve comment to reflect it's
      > specific source curve name".
      > (The generic DRES curve came from the specific curve named ILDED).
      >
      > ; Attempt to auto-replace second variable based on presence of first.
      > ^!SetCursor 1:1
      > ^!IfTrue ^!Find "LATED" ^!Set %DRES%=LATED
      > ^!SetCursor 1:1
      > ^!IfTrue ^!Find "ILDED" ^!Set %DRES%=ILDED
      > ^!SetCursor 1:1
      > ^!IfTrue ^!Find "AT90ED" ^!Set %DRES%=AT90ED
      > ; etc... for many types of possible deep resistivity names, one of
      which is
      > the source of my DRES curve.
      >
      > ^!Info ^%DRES%
      > ; LAST STEP, change comment to the one that was found in the file.
      > ^!REPLACE DRESWS.OHMM DRESWS.OHMM : DEEP RESISTIVITY [^%DRES%]
      SWIC
      >
      > This does not work, and I am not sure of where I am going wrong
      (probably
      > punctuation), but want to show that I making some effort.
      >
      > Mr. Phillip Sand Hansel II

      Phillip,

      In your examples, ^!IfTrue ^!Find "ILDED" ^!Set %DRES%=ILDED, there are
      3 clip commands strung together. The ^!IfTrue another ^!If value.

      If, for instance, you had, ^!IfTrue "ILDED" ^!Set %DRES%=ILDED, and
      'ILDED' represented a true/false, 0/1, something that could be judged on
      a t/f basis it would work

      Like Alan, I'm not sure I understand the replace line. I modified the
      line in my example, is this what you intended? Alan gave you an option
      you could work with, here's another.

      <>····· Start Clip ·····<>
      H="Change Generic Curve Comment To Reflect Specific Source Curve Name"
      ^!ClearVariables
      ^!Jump 1
      ^!Find ILDED|AT90ED|LATED RS
      ^!IfError EXIT
      ^!Set %DRES%=^$GetSelection$
      ^!Info [L]^%DRES%
      ;
      ; LAST STEP, change comment to the one that was found in the file.
      ^!Replace "DRESWS.OHMM DRESWS.OHMM" >> ": DEEP RESISTIVITY [^%DRES%]"
      CIWS
      <>····· End Clip ·····<>

      Breakdown;

      Clears all variables

      ^!Jump 1 - moves cursor to top-left of doc

      ^!Find ILDED|AT90ED|LATED RS -- finds either of the 3 terms, using
      regex and terms separated by vertical bar. Finds the first occurrence
      of either of the 3, whichever appears first in the file. More than 3
      terms can be incorporated in the ^!Find using regex.

      ^!IfError EXITs clip if nothing found.

      ^!Set %DRES%=^$GetSelection$ -- The 'found' term is hi-lited by the
      ^!Find operation and assigned to the variable %DRES%.

      Info is informational, just shows you which term was the first found term
    • hsavage
      ... Phillip, In my example clip is an error. ^!Find ILDED|AT90ED|LATED RS, should be stated as, ^!Find (ILDED)|(AT90ED)|(LATED) RS, with each term in
      Message 2 of 11 , Jun 9, 2006
        hsavage wrote:
        > Phillip Sand Hansel II wrote:
        >> Greetings:
        >>
        >> I am trying to find out if a word is in a file I am editing, and if
        >>
        >> ; Attempt to auto-replace second variable based on presence of first.
        >> ^!SetCursor 1:1
        >>
        >> Mr. Phillip Sand Hansel II
        >
        > Phillip,
        >
        > <>····· Start Clip ·····<>
        > H="Change Generic Curve Comment To Reflect Specific Source Curve Name"
        > ^!ClearVariables
        > ^!Jump 1
        > ^!Find ILDED|AT90ED|LATED RS
        > ^!IfError EXIT
        > ^!Set %DRES%=^$GetSelection$
        > ^!Info [L]^%DRES%
        > ;
        > ; LAST STEP, change comment to the one that was found in the file.
        > ^!Replace "DRESWS.OHMM DRESWS.OHMM" >> ": DEEP RESISTIVITY [^%DRES%]"
        > CIWS
        > <>····· End Clip ·····<>

        Phillip,

        In my example clip is an error. ^!Find ILDED|AT90ED|LATED RS, should be
        stated as, ^!Find (ILDED)|(AT90ED)|(LATED) RS, with each term in
        parentheses, this applies to NoteTab Pro 4.95.

        ºvº
        06.06.09_11.04
        "Cooking III; How Not to Inflict Your Diets on Other People."
        hrs ø hsavage@...
      • Alan_C
        ... [ . . ] ... Superb. But it is different in that it makes just one pass through so as to locate only any one out of the three. Op s original clip, for
        Message 3 of 11 , Jun 9, 2006
          On Friday 09 June 2006 07:55, hsavage wrote:
          > Phillip Sand Hansel II wrote:
          > > Greetings:
          [ . . ]
          > <>····· Start Clip ·····<>
          > H="Change Generic Curve Comment To Reflect Specific Source Curve Name"
          > ^!ClearVariables
          > ^!Jump 1
          > ^!Find ILDED|AT90ED|LATED RS
          > ^!IfError EXIT
          > ^!Set %DRES%=^$GetSelection$
          > ^!Info [L]^%DRES%
          > ;
          > ; LAST STEP, change comment to the one that was found in the file.
          > ^!Replace "DRESWS.OHMM DRESWS.OHMM" >> ": DEEP RESISTIVITY [^%DRES%]"
          > CIWS
          > <>····· End Clip ·····<>

          Superb. But it is different in that it makes just one pass through so as to
          locate only any one out of the three.

          Op's original clip, for whatever reason, make three passes through, each time
          looking for one of the three (and if found, reset the var with what was
          found).

          So (OP) the var could get reset three times whereas in code above it only find
          one of the three and then set the var just once, even if all three are in
          doc.

          But I don't fully grasp what/why the OP reset the var up to three times given
          if three are found.

          So perhaps the above is what is needed.

          I'm just pointing out (mostly to the OP as I'm sure that H.S. knows already)
          that difference(s) exist.

          --
          Alan.
        • Don - HtmlFixIt.com
          I love IfError for just these kinds of situations.
          Message 4 of 11 , Jun 10, 2006
            I love IfError for just these kinds of situations.
            >> ^!IfError EXIT
          • Phillip Sand Hansel II
            Thank you. I very much appreciate your insight (hsavage, et al). ... looking for one of the three (and if found, reset the var with what was found). I knew my
            Message 5 of 11 , Jun 11, 2006
              Thank you. I very much appreciate your insight (hsavage, et al).

              >>Op's original clip, for whatever reason, make three passes through, each
              >>time
              looking for one of the three (and if found, reset the var with what was
              found).

              I knew my method was not elegant, I broke it down into steps I could
              understand. The RegEx method is much better CPU wise and maintenance wise. I
              mean, it will be easier for me to grow the list. On all wells, there is the
              possibility of hundreds, but in any one well, there is probably only one
              Deep Resistivity curve that I need to make a customized comment for. [Then
              there's a Medium, and a Shallow, a density, a gamma ray, a neutron and a
              sonic...etc... several different flavours of the same problem. When I get
              one worked out, then it is cut & paste cloning time.]

              It is awkward to explain, I should have posted an example (I will next
              time). However both respondents answered the question; one told me
              specifically what was wrong with my example, and the other answered the
              question in the way that I should have asked it if I had known better.

              The First Respondents suggestion worked, turns out I was adding a few
              characters ^! on the skip statement and when that didn't work, I modified
              everything radically to something that didn't work worse.

              I created quite a large clip out of the FR's logic, but see the advantages
              of Mr. hsavage's method, so I'll be converting that 1st effort to the RegEx
              method.

              Thanks a lot, pretty soon I'll be able to do half of my job without thinking
              and in just a few clicks. This won't get me more money, but it will get me a
              few more minutes to sit out on my deck and watch the birds. :-)

              Mr. Phillip Sand Hansel II
              http://philliphansel.com
            • Phillip Sand Hansel II
              Everyone questioned the Last Step... I think that was because I was using Tab delimited Replace. If you don t see the tabs, or if email stripped them, it is
              Message 6 of 11 , Jun 11, 2006
                Everyone questioned the Last Step... I think that was because I was using
                Tab delimited Replace. If you don't see the tabs, or if email stripped them,
                it is harder to figure out.

                Maybe it should look like this...
                ^!Replace "DRESWS.OHMM" >> "DRESWS.OHMM : DEEP RESISTIVITY [^%DRES%]"
                CIWS

                I am trying to say, "if you find that word, replace it with itself, plus a
                colon followed by a descriptive comment that also mentions it's source curve
                name".

                This comment and source curve everybody else types in manually (tedious and
                prone to error; I shudder). I've got it 90% automatic and am trying to
                squeeze in that most complicated last 8% (2% of the cases I probably won't
                be able to clip my way out of, but that's not a problem considering.).

                I've made a lot of clips that work; they may not be pretty, but they get the
                job done. As I keep reading the list, I learn more elegant solutions.

                Thanks again,
                Mr. Phillip Sand Hansel II
                http://philliphansel.com


                ----- Original Message -----
                From: "Alan_C" <acummingsus@...>
                To: <ntb-clips@yahoogroups.com>
                Sent: Friday, June 09, 2006 2:14 PM
                Subject: Re: [Clip] Testing Conditions?


                > ; LAST STEP, change comment to the one that was found in the file.
                > ^!Replace "DRESWS.OHMM DRESWS.OHMM" >> ": DEEP RESISTIVITY [^%DRES%]"
                > CIWS
                > <>····· End Clip ·····<>
              • hsavage
                ... each ... density, ... flavours of the ... cloning time.] ... thinking ... get me a ... Phillip, If there are, in fact, hundreds of possibles the way you
                Message 7 of 11 , Jun 11, 2006
                  Phillip Sand Hansel II wrote:
                  > Thank you. I very much appreciate your insight (hsavage, et al).
                  >
                  >>> Op's original clip, for whatever reason, make three passes through,
                  each
                  >>> time
                  > looking for one of the three (and if found, reset the var with what was
                  > found).
                  >
                  > On all wells, there is the possibility of hundreds, but in any one well,
                  > there is probably only one Deep Resistivity curve that I need to make a
                  > customized comment for. [Then there's a Medium, and a Shallow, a
                  density,
                  > a gamma ray, a neutron and a sonic...etc... several different
                  flavours of the
                  > same problem. When I get one worked out, then it is cut & paste
                  cloning time.]

                  > It is awkward to explain, I should have posted an example (I will next
                  > time). However both respondents answered the question; one told me
                  > specifically what was wrong with my example, and the other answered the
                  > question in the way that I should have asked it if I had known better.
                  >
                  > Thanks a lot, pretty soon I'll be able to do half of my job without
                  thinking
                  > and in just a few clicks. This won't get me more money, but it will
                  get me a
                  > few more minutes to sit out on my deck and watch the birds. :-)
                  >
                  > Mr. Phillip Sand Hansel II
                  > http://philliphansel.com

                  Phillip,

                  If there are, in fact, hundreds of possibles the way you might want to
                  go is with an array populated by a small database of you compilation.
                  If enough possibles are included in your custom list/database you could
                  probably get by without having to edit the clip, at least not too often.

                  The array/database method should apply to any other repetitious use of
                  variables. You can add the other flavors into one clip and possibly use
                  Wizards to make the preliminary choices.

                  ºvº
                  06.06.11_20.00
                  "Driving a Car Safely; A Skill You 'CAN' Acquire."
                  hrs ø hsavage@...
                • hsavage
                  ... using ... stripped them, ... [^%DRES%] ... Phillip, Immediately apparent when double-arrow delimiter is used. ºvº 06.06.11_20.00 Driving a Car
                  Message 8 of 11 , Jun 11, 2006
                    Phillip Sand Hansel II wrote:
                    > Everyone questioned the Last Step... I think that was because I was
                    using
                    > Tab delimited Replace. If you don't see the tabs, or if email
                    stripped them,
                    > it is harder to figure out.
                    >
                    > Maybe it should look like this...
                    > ^!Replace "DRESWS.OHMM" >> "DRESWS.OHMM : DEEP RESISTIVITY
                    [^%DRES%]"
                    > CIWS
                    >
                    > Thanks again,
                    > Mr. Phillip Sand Hansel II

                    Phillip,

                    Immediately apparent when double-arrow '>>' delimiter is used.

                    ºvº
                    06.06.11_20.00
                    "Driving a Car Safely; A Skill You 'CAN' Acquire."
                    hrs ø hsavage@...
                  Your message has been successfully submitted and would be delivered to recipients shortly.