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

Re: [Clip] Add a to every line, clip needed

Expand Messages
  • hsavage
    ... instead ... line. ... dacy, JMVW, JMV gave you the same resolution I planned to send, flipping the and the 1. Before I sent I wondered if your
    Message 1 of 16 , Dec 29, 2005
    • 0 Attachment
      JMVWare wrote:
      > The /1 is where the linefeed goes. Just move it to before4 thr BR
      instead
      > of after.
      >
      > ----- Original Message -----
      > From: "dacystorm" <dacy.storm@...>
      > Subject: Re: [Clip] Add a <BR> to every line, clip needed
      >
      > Thankyou for the clip, but when i run it, it adds the <BR> to the end
      > of every line. I want the <BR> to be added in the beginning of every
      line.
      >
      >> dacystorm wrote:
      >>> I need a clip that adds <BR> to every line of the document.
      >>> Not replacing the existing text, just adding the <BR>.
      >>
      >> Just select one line or many lines in a group and run the clip, if you
      >> want lower or upper case change the clip accordingly by deleting or
      >> commenting out the other Replace line.
      >>
      >> -------------------------
      >> H="Add <br>"
      >> ; select one line or many lines you wish to add the suffix to.
      >> ; run clip
      >> ^!Replace "{\n+}" >> "<br>\1" HRSA
      >> ^!Replace "{\n+}" >> "<BR>\1" HRSA
      >> -------------------------

      dacy, JMVW,

      JMV gave you the same resolution I planned to send, flipping the <br>
      and the \1. Before I sent I wondered if your document may have blank
      lines or leading spaces or tabs.

      So, I've been working on a resolution for that consideration. I finally
      have a short clip that places <br> at the start of each line of text,
      disregarding blank lines and if there should be leading tabs or spaces
      it places the <br> immediately before the text, to the right of tabs and
      spaces. Blank lines are also untouched, no extraneous line breaks(<br>).

      The new clip ignores leading tabs, spaces and blank lines in the text.
      Just select from the starting line, down to, and including the final
      line to be edited and run the clip.

      The new clip follows the revised original clip.

      -------------------------
      H="Add <br>"
      ; select one line or many lines you wish to add the suffix to.
      ; run clip
      ^!Replace "{\n+}" >> "\1<br>" HRSA
      -------------------------

      -------------------------
      H="<br>Add"
      ; select one line or as many lines you wish to add the suffix to.
      ; run clip
      ^!SetScreenUpdate 0
      ^!Set %start%=^$GetRow$
      ^!Jump SELECT_END
      ^!Set %end%=^$Calc(^$GetRow$-1)$
      ^!KeyBoard LEFT
      ^!SelectTo ^%start%:1
      ^!Replace {^[\n\t\s]*} >> \1<br> HRSA
      -------------------------

      ºvº
      05.12.29
      'Silence, the Final Frontier:'
      'Where No Woman Has Gone Before.'
      hrs > hsavage@...
    • gunnisonbirder
      ... Hello, I have tried above clip and can t make it work? Is it because I am using notetab pro ver: 5.61? Above clip was originally written in 2005. I
      Message 2 of 16 , Apr 5, 2009
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "dacystorm" <dacy.storm@...> wrote:
        >
        > Thankyou for the clip, but when i run it, it adds the <BR> to the end
        > of every line. I want the <BR> to be added in the beginning of every line.
        >
        > --- In ntb-clips@yahoogroups.com, hsavage <hsavage@p...> wrote:
        > >
        > > dacystorm wrote:
        > > > Hello, this should be easy... (maybe)
        > > >
        > > > I need a clip that adds <BR> to every line of the document.
        > > > Not replacing the existing text, just adding the <BR>.
        > > >
        > > > Help much appreciated, thanx
        > >
        > > This assumes there might be a few lines you don't want <br> added,
        > e.g.,
        > > html header lines.
        > >
        > > Just select one line or many lines in a group and run the clip, if you
        > > want lower or upper case change the clip accordingly by deleting or
        > > commenting out the other Replace line.
        > >
        > > -------------------------
        > > H="Add <br>"
        > > ; select one line or many lines you wish to add the suffix to.
        > > ; run clip
        > > ^!Replace "{\n+}" >> "<br>\1" HRSA
        > > ^!Replace "{\n+}" >> "<BR>\1" HRSA
        > > -------------------------
        > >
        > > ºvº
        > > 05.12.28
        > > 'Meandering to a different drummer.'
        > > hrs > hsavage@p...
        > >
        >
        Hello, I have tried above clip and can't make it work? Is it because I am using notetab pro ver: 5.61? Above clip was originally written in 2005. I would like a clip to add <br> to end of every line with some blank lines which I would also like to add <br> Thanks for any suggestions.
      • Axel Berger
        ... Yes it is, that clip is in the old syntax. The following is untested but ought to work: H= Add ; select one line or many lines you wish to add the
        Message 3 of 16 , Apr 6, 2009
        • 0 Attachment
          gunnisonbirder wrote:
          > Is it because I am using notetab pro ver: 5.61?

          Yes it is, that clip is in the old syntax. The following is untested
          but ought to work:

          H="Add <br>"
          ; select one line or many lines you wish to add the suffix to.
          ; run clip
          ^!Replace "(\R)" >> "<br>$1" HRSA

          Axel
        • Don Daugherty
          ... How about this: ^!Replace ^ RHSA
          Message 4 of 16 , Apr 6, 2009
          • 0 Attachment
            gunnisonbirder wrote:
            >> when i run it, it adds the <BR> to the end
            >> of every line. I want the <BR> to be added in the beginning of every line.
            How about this: ^!Replace "^" >> "<br>" RHSA
          • Axel Berger
            ... No, the caret on its own means nothing. This ought to work: ^!Replace ^(.+?)$ $1 HRAS It only looks for lines with a content of at least one
            Message 5 of 16 , Apr 6, 2009
            • 0 Attachment
              Don Daugherty wrote:
              > How about this: ^!Replace "^" >> "<br>" RHSA

              No, the caret on its own means nothing. This ought to work:

              ^!Replace "^(.+?)$" >> "<br>$1" HRAS

              It only looks for lines with a content of at least one character, not
              empty ones. For the latter case use

              ^!Replace "^(.*?)$" >> "<br>$1" HRAS

              instead.
              Axel
            • Sheri
              ... Better go back to regex school. :D Regards, Sheri
              Message 6 of 16 , Apr 6, 2009
              • 0 Attachment
                --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:
                >
                > Don Daugherty wrote:
                > > How about this: ^!Replace "^" >> "<br>" RHSA
                >
                > No, the caret on its own means nothing.

                Better go back to regex school. :D

                Regards,
                Sheri
              • Axel Berger
                ... If you say so, I d better take heed. Thanks for the correction Axel
                Message 7 of 16 , Apr 6, 2009
                • 0 Attachment
                  Sheri wrote:
                  > Better go back to regex school. :D

                  If you say so, I'd better take heed.

                  Thanks for the correction
                  Axel
                • gunnisonbirder
                  ... This works great! Thanks!
                  Message 8 of 16 , Apr 6, 2009
                  • 0 Attachment
                    --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:
                    >
                    > gunnisonbirder wrote:
                    > > Is it because I am using notetab pro ver: 5.61?
                    >
                    > Yes it is, that clip is in the old syntax. The following is untested
                    > but ought to work:
                    >
                    > H="Add <br>"
                    > ; select one line or many lines you wish to add the suffix to.
                    > ; run clip
                    > ^!Replace "(\R)" >> "<br>$1" HRSA
                    >
                    > Axel
                    >

                    This works great! Thanks!
                  • Bert Byfield
                    Here s what I ended up with (uses a choice of prefixes): Insert Prefix to Lines 2 ; this one leaves empty lines alone: ; ^!Replace ^(.+)$
                    Message 9 of 16 , Apr 6, 2009
                    • 0 Attachment
                      Here's what I ended up with (uses a choice of prefixes):

                      Insert Prefix to Lines 2
                      ; this one leaves empty lines alone:
                      ; ^!Replace "^(.+)$" >> "^?[(T=C;H=6)Prefix to Insert is
                      =_!|//|rem|;|'|^T]$1" HRAS
                      ; this one inserts the prefix on empty lines too:
                      ^!Replace "^(.*)$" >> "^?[(T=C;H=6)Prefix to Insert is
                      =_!|//|rem|;|'|^T]$1" HRAS

                      (The Replace lines are split by my mail program)
                    Your message has been successfully submitted and would be delivered to recipients shortly.