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

[Clip] Re: regexp

Expand Messages
  • Michael Gerholdt
    I figured out how to do the shrinking I needed as follows. There is a space between the two ^P in the first instance and not in the second. Would still like
    Message 1 of 5 , Jan 31, 2000
    • 0 Attachment
      I figured out how to do the 'shrinking' I needed as follows. There is a
      space between the two ^P in the first instance and not in the second.

      Would still like to know more about regexp and how they could work in this
      or a similar case.

      :shrink
      ^!Replace "^P ^P" >> "^P" WAIST
      ^!IfError shrinker
      ^!Goto shrink
      :shrinker
      ^!Replace "^P^P" >> "^P" WAIST
      ^!IfError exit
      ^!Goto shrinker


      Thanks,
      --Michael Gerholdt

      > Can someone tell me how to use regular expression to do this:
      >
      > ^!Replace "Any number/combination of ^P and (spaces that occur only on
      lines
      > where there is no other text)" >> "^P"
      >
      > So that all single line feeds will be replaced with single line feeds -
      > preserving them;
      > and all chunks of white space between lines that have text will
      disappear -
      >
      > and I've found that some of those lines will have spaces on them from time
      > to time and I need to accomodate that.
    • Jody
      Hi Michael ... ^!Replace ^P ^P ^P WAIST ^!Replace ^P^P ^P WAIST Doesn t that do the same thing? In Jesus Love, Bro. Jody Adair Prov. 3:5-7; 4:23
      Message 2 of 5 , Jan 31, 2000
      • 0 Attachment
        Hi Michael

        > I figured out how to do the 'shrinking' I needed as follows.

        ^!Replace "^P ^P" >> "^P" WAIST
        ^!Replace "^P^P" >> "^P" WAIST

        Doesn't that do the same thing?

        In Jesus' Love,
        Bro. Jody Adair
        Prov. 3:5-7; 4:23

        Behold, I send you forth as sheep in the midst of wolves:
        be ye therefore wise as serpents, and harmless as doves.
        Matthew 10:16

        |||||
        (o o)
        oOOo-(_)-oOOo

        http://www.sureword.com/kjb1611
      • Michael Gerholdt
        ^!Replace ^P ^P ^P WAIST ^!Replace ^P^P ^P WAIST ... ^!Replace ^P ^P ^P WAIST ^!IfError shrinker ^!Goto shrink ... ^!Replace ^P^P
        Message 3 of 5 , Jan 31, 2000
        • 0 Attachment
          ^!Replace "^P ^P" >> "^P" WAIST
          ^!Replace "^P^P" >> "^P" WAIST


          Jody asks if the above doesn't do the same as the below:

          :shrink
          ^!Replace "^P ^P" >> "^P" WAIST
          ^!IfError shrinker
          ^!Goto shrink
          :shrinker
          ^!Replace "^P^P" >> "^P" WAIST
          ^!IfError exit
          ^!Goto shrinker

          One would think so, but it doesn't as once the simple lines execute through
          the doc once they think they are finished since they've gone all the way
          through.

          In fact they've only started the job, for there there were, for example, 8
          empty lines there are now only four ... but still four.

          So it is necessary to loop back through and re-execute until errrortrapping
          halts the process.

          I have to execute yours twice to get the latter fully collapsed:

          Cream Of Broccoli Soup
          Grilled Chicken Breast
          Hot Roast Beef Sandwich/Gravy
          Chicken Fingers
          Red Beans & Rice


          Steak Fries
          Carrots

          Kaiser Rolls
          Weck Rolls
          Horseradish
          Ketchup
          Blue Cheese w/ Celery Sticks
          Peanut Butter Cookies
          Brownies


          Vegetarian Vegetable Soup
          Baked Cod
          Chicken Parmesan
          Spaghetti w/Meat Sauce
          Beans and Grain Shell



          Stir Fry Vegetables
          Bread Sticks
          Soy Sauce
          Parmesan Cheese
          Tartar Sauce
          Chocolate Sheet Cake
          Dutch Cherry Pie

          later,
          Mike
        • Jody
          Hi Michael, ... Dummy me. I know that - I have loop segments in many clips to do that and even have a template Clip so I don t have to write it all the
          Message 4 of 5 , Jan 31, 2000
          • 0 Attachment
            Hi Michael,

            > One would think so,

            Dummy me. I know that - I have loop segments in many clips to do
            that and even have a "template" Clip so I don't have to write it
            all the time. I reported it to Eric in the past and have it my
            bug list to send him when he is ready for them. Your post follows:

            ^!Replace "^P ^P" >> "^P" WAIST
            ^!Replace "^P^P" >> "^P" WAIST

            Jody asks if the above doesn't do the same as the below:

            :shrink
            ^!Replace "^P ^P" >> "^P" WAIST
            ^!IfError shrinker
            ^!Goto shrink
            :shrinker
            ^!Replace "^P^P" >> "^P" WAIST
            ^!IfError exit
            ^!Goto shrinker

            > One would think so,

            c ya,
            Jody

            The whole world doth err save you
            and me and even thou doest err some!

            http://www.sureword.com/sojourner
          • Andreas K├╝stermeyer
            Hi Michael, Perhaps that s what your are looking for. Deleting all the blank lines between your text? like: Line1 Not this line Line2 ....
            Message 5 of 5 , Jan 31, 2000
            • 0 Attachment
              Hi Michael,

              Perhaps that's what your are looking for.
              Deleting all the blank lines between your text?
              like:

              Line1 Not this line
              Line2 .... <---spaces
              Line3
              Line4 ....not this line

              result:

              Line1 Not this line
              Line2 ....not this line


              :shrink
              ^!Replace " ^P" >> "^P" WAIST
              ^!IfError shrinker
              ^!Goto shrink

              :shrinker
              ^!Replace "^P^P" >> "^P" WAIST
              ^!IfError exit
              ^!Goto shrinker

              Regards,
              Andreas
            Your message has been successfully submitted and would be delivered to recipients shortly.