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

RE: [Clip] Removing and adding characters to a line

Expand Messages
  • John Shotsky
    This clip would do what you want: ^!Replace (::) R ^%NL%$1 ARSTW (Add a space before $1 if you need it.) You can use that in the find/replace dialog,
    Message 1 of 8 , Jun 20, 2008
    • 0 Attachment
      This clip would do what you want:

      ^!Replace "(::)\R" >> "^%NL%$1" ARSTW (Add a space before $1 if you need it.)

      You can use that in the find/replace dialog, just check the regular expression box and the case sensitive box.

      For your other task, if you want every line to start with XXX-, you can use this clip, or use the find/replace dialog:

      ^!Replace "^(.)" >> "XXX-$1" ARSTW

      John


      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of gunnisonbirder
      Sent: Friday, June 20, 2008 2:45 AM
      To: ntb-clips@yahoogroups.com
      Subject: [Clip] Removing and adding characters to a line

      I have about 2000 lines that all end with :: Can a clip be written to
      remove these from all lines? I can't use find/replace because ::
      occur in other locations in the lines.

      I would then like to add :: to the beginning of all lines. Can one
      clip accomplish both tasks or would it require two clips? I am using
      Notetab Pro 5.4

      Other occasions have come up where I would like to add characters to
      the beginning of a line (not just ::) Spent hours trying to get a
      clip to make this work; without success.

      Thanks for any suggestions!



      [Non-text portions of this message have been removed]
    • Don - HtmlFixIt.com
      ... ^!Jump Doc_Start ^!InsertText :: ^!Replace ::^P ^P:: ACIWS Won t work on the last line unless you have an carriage return at the end. Not tested,
      Message 2 of 8 , Jun 20, 2008
      • 0 Attachment
        gunnisonbirder wrote:
        > I have about 2000 lines that all end with :: Can a clip be written to
        > remove these from all lines? I can't use find/replace because ::
        > occur in other locations in the lines.
        >
        > I would then like to add :: to the beginning of all lines. Can one
        > clip accomplish both tasks or would it require two clips? I am using
        > Notetab Pro 5.4
        >
        > Other occasions have come up where I would like to add characters to
        > the beginning of a line (not just ::) Spent hours trying to get a
        > clip to make this work; without success.
        >
        > Thanks for any suggestions!

        ^!Jump Doc_Start
        ^!InsertText ::
        ^!Replace "::^P" >> "^P::" ACIWS

        Won't work on the last line unless you have an carriage return at the
        end. Not tested, so work on a backup.
      • John Shotsky
        After rereading the question, I realized that the request was for a single clip to do both jobs.this one will do that: ^!Replace (::)? R(::)? ^%NL::
        Message 3 of 8 , Jun 20, 2008
        • 0 Attachment
          After rereading the question, I realized that the request was for a single clip to do both jobs.this one will do that:

          ^!Replace "(::)?\R(::)?" >> "^%NL::" ARSTW (Add a space after :: if you need it.)


          John

          From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of John Shotsky
          Sent: Friday, June 20, 2008 5:44 AM
          To: ntb-clips@yahoogroups.com
          Subject: RE: [Clip] Removing and adding characters to a line

          This clip would do what you want:

          ^!Replace "(::)\R" >> "^%NL%$1" ARSTW (Add a space before $1 if you need it.)

          You can use that in the find/replace dialog, just check the regular expression box and the case sensitive box.

          For your other task, if you want every line to start with XXX-, you can use this clip, or use the find/replace dialog:

          ^!Replace "^(.)" >> "XXX-$1" ARSTW

          John


          From: ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> [mailto:ntb-clips@yahoogroups.com
          <mailto:ntb-clips%40yahoogroups.com> ] On Behalf Of gunnisonbirder
          Sent: Friday, June 20, 2008 2:45 AM
          To: ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com>
          Subject: [Clip] Removing and adding characters to a line

          I have about 2000 lines that all end with :: Can a clip be written to
          remove these from all lines? I can't use find/replace because ::
          occur in other locations in the lines.

          I would then like to add :: to the beginning of all lines. Can one
          clip accomplish both tasks or would it require two clips? I am using
          Notetab Pro 5.4

          Other occasions have come up where I would like to add characters to
          the beginning of a line (not just ::) Spent hours trying to get a
          clip to make this work; without success.

          Thanks for any suggestions!


          [Non-text portions of this message have been removed]



          [Non-text portions of this message have been removed]
        • frank
          hi gunnison, don, et.al. these are what I use: ============================== H= Add blank row DOC END ^!SetWordWrap Off ^!Jump DOC_END ^!KEYBOARD ENTER
          Message 4 of 8 , Jun 20, 2008
          • 0 Attachment
            hi gunnison, don, et.al.

            these are what I use:

            ==============================

            H="Add blank row DOC END"
            ^!SetWordWrap Off
            ^!Jump DOC_END
            ^!KEYBOARD ENTER
            ^!Jump DOC_START
            ^!Save

            H="Insert [ string ] at [ n ] Spaces"
            ^!SetWordWrap Off
            ^!SetWizardLabel Insert At nnn Spaces
            ^!Set %Insert%=^?[Select text to insert]
            ^!Set %Where%=^?[number of spaces to begin insert]
            ^!Set %Counter%=^?[How many lines?]
            :Loop
            ^!MoveCursor +^%Where%
            ^!InsertText ^%Insert%
            ^!Jump +1
            ^!Dec %Counter%
            ^!If ^%Counter% > 0 Loop Else End

            H="Add [string] EOL all lines"
            ^!SetWordWrap Off
            ^!SetWizardLabel Add To End of Row
            ^!Set %Insert%=^?[Select text to add to the end of each row]
            ^!Set %Counter%=^?[How many lines?]
            :Loop
            ^!Jump LINE_END
            ^!InsertText ^%Insert%
            ^!Jump +1
            ^!Dec %Counter%
            ^!If ^%Counter% > 0 Loop Else End

            ===================================

            to insert a string at the beginning of each line use 0 as the number
            of spaces to begin insert. make sure the file ends with a line return.
            make sure your cursor is at col 1 on the row you want to start from.
            if you want to edit all rows you will need to know the row count. you
            could easily build a clip to count the rows, I just eyeball it since I
            usually scroll to the end checking for anomalies before I edit.

            regards,

            tf
          • gunnisonbirder
            Thanks for all the great suggestions. The find/replace worked well. I can use the clip on future changes which I seem to do often.
            Message 5 of 8 , Jun 22, 2008
            • 0 Attachment
              Thanks for all the great suggestions. The find/replace worked well. I
              can use the clip on future changes which I seem to do often.
            Your message has been successfully submitted and would be delivered to recipients shortly.