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

How do I paste into the last half of a file (until reached)?

Expand Messages
  • Ron Ball
    Hi Anyone, I want to be able to repeat something until I reach the end of the file and not repeat the insert a bunch of times on the last line. Anyone have any
    Message 1 of 5 , Jun 29, 2005
    • 0 Attachment
      Hi Anyone,

      I want to be able to repeat something until I reach the end of the
      file and not repeat the insert a bunch of times on the last line.
      Anyone have any ideas? I may start this clip half way thru my file
      to only add to the last half of the file.

      For example, ...

      H="Paste Until End Of File"
      ;Beginning of loop
      :StartLoop
      ^!Keyboard Home
      ^!Keyboard #'\\Todo:#
      ^!Keyboard Down
      ;EXIT THE LOOP WHEN WE ARE AT END OF FILE
      ???? I don't know what to put here ????
      ;Jump back to the start of the loop
      ^!Goto StartLoop

      Thanks - Ron Ball
    • Don - htmlfixit.com
      ... Give this a whirl Ron. I don t have any idea what you are actually doing here with the Keyboard commands, but the line I inserted should stop you if you
      Message 2 of 5 , Jun 29, 2005
      • 0 Attachment
        > I want to be able to repeat something until I reach the end of the
        > file and not repeat the insert a bunch of times on the last line.
        > Anyone have any ideas?

        Give this a whirl Ron. I don't have any idea what you are actually
        doing here with the Keyboard commands, but the line I inserted should
        stop you if you are on the last line of the file.

        H="Paste Until End Of File"
        ;Beginning of loop
        :StartLoop
        ^!Keyboard Home
        ^!Keyboard #'\\Todo:#
        ^!Keyboard Down
        ;EXIT THE LOOP WHEN WE ARE AT END OF FILE
        ^!If ^%row% = ^$GetLinecount$ END ELSE StartLoop
      • hsavage
        ... Hi Ron, Don, The problem is the clip hasn t set a %row% variable so I think we need to substitute ^$GetRow$ for ^%row%. There s still a problem with this,
        Message 3 of 5 , Jun 29, 2005
        • 0 Attachment
          Don - htmlfixit.com wrote:
          >> I want to be able to repeat something until I reach the end of the
          >> file and not repeat the insert a bunch of times on the last line.
          >> Anyone have any ideas?
          >
          > Give this a whirl Ron. I don't have any idea what you are actually
          > doing here with the Keyboard commands, but the line I inserted should
          > stop you if you are on the last line of the file.
          >
          > H="Paste Until End Of File"
          > ;Beginning of loop
          > :StartLoop
          > ^!Keyboard Home
          > ^!Keyboard #'\\Todo:#
          > ^!Keyboard Down
          > ;EXIT THE LOOP WHEN WE ARE AT END OF FILE
          > ^!If ^%row% = ^$GetLinecount$ END ELSE StartLoop

          Hi Ron, Don,

          The problem is the clip hasn't set a %row% variable so I think we need
          to substitute ^$GetRow$ for ^%row%.

          There's still a problem with this, if there's more than 1 blank line at
          the end of file the clip will add '\\Todo: to the blank lines.

          It would help greatly to know the primary format of the file to be altered.

          ^!If ^$GetRow$ = ^$GetTextLineCount$ END ELSE StartLoop

          ºvº
          05.06.29
          hrs > hsavage@...
        • hsavage
          ... Ron, Here s a mod to try. It should run until it finds a blank line, then Exit. H= Paste Until EOF ... ^!Keyboard Home ^!Keyboard # Todo:# ^!Keyboard
          Message 4 of 5 , Jun 29, 2005
          • 0 Attachment
            Ron Ball wrote:
            > Hi Anyone,
            >
            > I want to be able to repeat something until I reach the end of the
            > file and not repeat the insert a bunch of times on the last line.
            > Anyone have any ideas? I may start this clip half way thru my file
            > to only add to the last half of the file.
            >
            > For example, ...
            >
            > H="Paste Until End Of File"
            > ;Beginning of loop
            > :StartLoop
            > ^!Keyboard Home
            > ^!Keyboard #'\\Todo:#
            > ^!Keyboard Down
            > ;EXIT THE LOOP WHEN WE ARE AT END OF FILE
            > ???? I don't know what to put here ????
            > ;Jump back to the start of the loop
            > ^!Goto StartLoop
            >
            > Thanks - Ron Ball

            Ron,

            Here's a mod to try. It should run until it finds a blank line, then Exit.

            H="Paste Until EOF"
            :StartLoop
            ^!Keyboard Home
            ^!Keyboard #'\\Todo:#
            ^!Keyboard Down
            ^!If "^$GetLine$" = "" EXIT ELSE StartLoop

            ºvº
            05.06.30
            hrs > hsavage@...
          • abairheart
            ... ^!If ^$GetRow$
            Message 5 of 5 , Jul 1, 2005
            • 0 Attachment
              --- In ntb-clips@yahoogroups.com, "Ron Ball" <RonBall42@a...> wrote:
              > ...
              >
              > H="Paste Until End Of File"
              > ;Beginning of loop
              > :StartLoop
              > ^!Keyboard Home
              > ^!Keyboard #'\\Todo:#
              > ^!Keyboard Down
              > ;EXIT THE LOOP WHEN WE ARE AT END OF FILE

              > ???? I don't know what to put here ????

              ^!If ^$GetRow$<= ^$GetTextLineCount$ StartLoop


              Note that the test either succeeds, and jumps back up,
              or fails and drops out of the loop.


              However! since you appear to want to insert "'\\Todo:"
              at the beginning of the line, why not just use replace?

              Plasce your cursor where you want to start replaceing and
              run the clip command:

              ^!Replace ^P ^P'Todo: AS

              That should replace every start of the line with the start AND the
              text, to the end of the document.

              If it doesn't work, read Help about the ^Replace command and its
              switches.
            Your message has been successfully submitted and would be delivered to recipients shortly.