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

Insert string at the start of each line of a block

Expand Messages
  • Jim Eoff
    I have a block of lines which have been split (Modify | Lines | Split Lines) and the text of the block is selected. I hope to have a string of my choice
    Message 1 of 6 , Apr 29, 2011
    • 0 Attachment
      I have a block of lines which have been split (Modify | Lines | Split
      Lines) and the text of the block is selected.

      I hope to have a string of my choice inserted at the start of each
      selected line.

      The following was suggested in response to a suggestion to support, but
      I need help to implement it (or whatever method works):

      > Thank you for your suggestion. However you can do this with NoteTab's
      > Replace feature. If you select text, the Replace feature will be limited
      > to the selected text. You can use a Regular Expression to replace all the
      > selected text with itself, plus your leading character(s).

      Thanks
    • Axel Berger
      ... ^!Replace ^P ^Pa string of my choice HASTI The problem with this is, it will miss the first line and do one too much after the last. So let s
      Message 2 of 6 , Apr 29, 2011
      • 0 Attachment
        Jim Eoff wrote:
        > Lines) and the text of the block is selected.
        > I hope to have a string of my choice inserted at the start of each
        > selected line.

        ^!Replace "^P" >> "^Pa string of my choice " HASTI


        The problem with this is, it will miss the first line and do one too
        much after the last. So let's better make it

        ^!Replace "^(.*)$" >> "a string of my choice $1" HRASTI

        After that your block won't be selected any more.

        Axel
      • flo.gehrke
        ... You don t need a clip for that. In Start | Replace (Ctrl+R), check the Regular Exp. box. Enter a caret ^ into the Reg.Expr. field, insert your
        Message 3 of 6 , Apr 30, 2011
        • 0 Attachment
          --- In ntb-clips@yahoogroups.com, "Jim Eoff" <jimeoff@...> wrote:
          >
          > I have a block of lines which have been split (Modify | Lines |
          > Split Lines) and the text of the block is selected.
          >
          > I hope to have a string of my choice inserted at the start of
          > each selected line.

          You don't need a clip for that. In 'Start | Replace' (Ctrl+R), check the 'Regular Exp.' box. Enter a caret '^' into the 'Reg.Expr.' field, insert your string into the 'Replace with' field, and start the job with 'OK'.

          Regards,
          Flo
        • Axel Berger
          ... Hey, that really works. I would not have expected the caret on its own to find and match anything. Something learnt, thanks Flo. Still, Jim has already got
          Message 4 of 6 , Apr 30, 2011
          • 0 Attachment
            "flo.gehrke" wrote:
            > Enter a caret '^' into the 'Reg.Expr.' field, insert your
            > string into the 'Replace with' field, and start the job

            Hey, that really works. I would not have expected the caret on its own
            to find and match anything. Something learnt, thanks Flo. Still, Jim has
            already got a two-step process, reformatting the lines and inserting the
            strings, so one clip is already easier than two deep sub-menus.

            Axel
          • Alec Burgess
            ... One additional way to tackle this is Quote and UnQuote - clicking Quote button if you have it on your toolbar will insert at beginning of selected lines.
            Message 5 of 6 , Apr 30, 2011
            • 0 Attachment
              On 2011-04-30 13:35, Axel Berger wrote:
              > "flo.gehrke" wrote:
              > > Enter a caret '^' into the 'Reg.Expr.' field, insert your
              > > string into the 'Replace with' field, and start the job
              >
              > Hey, that really works. I would not have expected the caret on its own
              > to find and match anything. Something learnt, thanks Flo. Still, Jim has
              > already got a two-step process, reformatting the lines and inserting the
              > strings, so one clip is already easier than two deep sub-menus.
              One additional way to tackle this is Quote and UnQuote - clicking Quote
              button if you have it on your toolbar will insert > at beginning of
              selected lines. The character(s) inserted may be changed in Options
              (though the Unquote always removes any number of > characters only
              regardless of quote characters setting)

              I often do this after splitting lines copied from an email to requote
              for copy back to the reply. I suspect OP may have wanted to do this?
              --
              Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)
            • Jim Eoff
              Thank you both for sharing your insight. Jim On Sat, 30 Apr 2011 19:35 +0200, Axel Berger
              Message 6 of 6 , May 2 8:59 AM
              • 0 Attachment
                Thank you both for sharing your insight.

                Jim



                On Sat, 30 Apr 2011 19:35 +0200, "Axel Berger" <Axel-Berger@...>
                wrote:
                > "flo.gehrke" wrote:
                > > Enter a caret '^' into the 'Reg.Expr.' field, insert your
                > > string into the 'Replace with' field, and start the job
                >
                > Hey, that really works. I would not have expected the caret on its own
                > to find and match anything. Something learnt, thanks Flo. Still, Jim has
                > already got a two-step process, reformatting the lines and inserting the
                > strings, so one clip is already easier than two deep sub-menus.
                >
                > Axel
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.