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

Need some help moving data

Expand Messages
  • Michael LaFountain
    Hi there Ladies & Gents, I m trying to eliminate a ^!Keyboard instruction from a clip I wrote. The clip is processing a lot of data and can take 20 to 30
    Message 1 of 6 , Aug 8 9:27 AM
    • 0 Attachment
      Hi there Ladies & Gents,

      I'm trying to eliminate a ^!Keyboard instruction from a clip I wrote.
      The clip is processing a lot of data and can take 20 to 30 minutes of
      run time. I think it is the ^!Keyboard command that causes errors if
      I try to run any other application while the script is processing
      (please tell me if this is true).

      Basically, I'm moving data from multiple columns into a single
      column. Here is an example of the before and after data and the piece
      of clip I'm using:

      =======
      BEFORE
      =======
      Data1 Data2 Data3
      Data4 Data5 Data6

      =====
      AFTER
      =====
      Data2 Data3
      Data4 Data5 Data6

      ^!MoveCursor 11
      ^!Select BOL
      ^!Keyboard Ctrl+X

      Can anyone show me an efficient way to do this? Everything I've
      thought of so far seems too complex.

      Thanks for the ^!help

      Mike LaFountain
      mlafount@...

      PS. I only subscribe to the summary list so I probably can't reply
      right away. If you prefer, you can email me at work at lafmi01@...
    • Jody
      Hi Michael, ... The ^!Keyboard command acts on whatever has the focus. Some shortcuts will not work if they are at the System level for a lack of better terms
      Message 2 of 6 , Aug 8 10:06 AM
      • 0 Attachment
        Hi Michael,

        > I think it is the ^!Keyboard command that causes errors if I
        > try to run any other application while the script is processing
        > (please tell me if this is true).

        The ^!Keyboard command acts on whatever has the focus. Some
        shortcuts will not work if they are at the System level for a
        lack of better terms or at least they did not in the past. They
        would be like Ctrl+Esc, but I have not tried them in a year or
        two. sometimes things start working with the only note from Eric
        being "* Other improvements" or * Other minor bugs fixed:, etc. ;)

        >Basically, I'm moving data from multiple columns into a single
        >column. Here is an example of the before and after data and the
        >piece of clip I'm using:
        >
        >=======
        >BEFORE
        >=======
        >Data1 Data2 Data3
        >Data4 Data5 Data6
        >
        >=====
        >AFTER
        >=====
        >Data2 Data3
        >Data4 Data5 Data6

        Your "After" does not line up with what you said above about
        moving the data into one column. If you want it all in one
        column why not just use the regular Replace tool. Find ^t (if it
        is a tab delimiter) and replace with ^p.

        ^!Replace "^t" >> "^p" WAS

        If spaces:

        ^!Replace " " >> "^p" WAS

        If that does not work for what you want, you can use some of the
        following:

        ^!Find "^t" S
        ^!Jump Select_End or Start
        :Loop
        ^!Goto Loop
        ^!Select Word
        ^!Toolbar Cut
        ^!Toolbar Paste (Might just be ^!Paste ;) or ^!InsertText ^$GetClipboard$

        Another way to to what you had above is the following - I did not
        check the syntax or test it but it looks good. <g>

        ^!Replace "^$GetField(1;1)$^t" >> "" S

        ^t = tab
        ^p = New line (CR/LF)

        >If you prefer, you can email me at work at lafmi01@...

        If you need to reply back, please do so to the list.

        Happy Clip'n!
        Jody

        http://www.sureword.com/notetab

        Subscribe, UnSubscribe, Options
        mailto:Ntb-Clips-Subscribe@...
        mailto:Ntb-Clips-UnSubscribe@...
        http://www.egroups.com/group/ntb-clips
      • Michael LaFountain
        ... the data into one column. You re right... but it does line up with how the clip statements: ^!MoveCursor 11 ^!Select BOL ^!Keyboard Ctrl+X would process
        Message 3 of 6 , Aug 8 10:36 AM
        • 0 Attachment
          --- In ntb-clips@egroups.com, Jody <KJB1611@a...> wrote:

          >======
          >BEFORE
          >======
          >Data1 Data2 Data3
          >Data4 Data5 Data6
          >
          >====
          >AFTER
          >====
          >Data2 Data3
          >Data4 Data5 Data6
          >
          >Your "After" does not line up with what you said above about moving
          the data into one column.

          You're right... but it does line up with how the clip statements:

          ^!MoveCursor 11
          ^!Select BOL
          ^!Keyboard Ctrl+X

          would process it; the Ctrl+X cuts the data to the clipboard and
          shifts the data to the left.

          Because the real data is both variable in length and value and also
          separated by spaces, the Find and ^T features won't work, but, it
          sure sounds like the ^!Toolbar Cut and ^!Toolbar Paste will do the
          trick. My head got sore trying to think of all the ^$Str functions
          that it might take to do this simple task. So being an old programmer
          (25yrs in the field) I remembered the old programmers saying... "If
          it just keeps getting more complex, your going about it the wrong
          way."

          Thanks Much & I'll let you know how it works.

          Mike LaFountain
        • Jody
          Hi Michael, ... You might run into a problem using ^!MoveCursor since the spacing is different. *If* there are no spaces in your data, then this should do
          Message 4 of 6 , Aug 8 11:38 AM
          • 0 Attachment
            Hi Michael,

            >^!MoveCursor 11
            >Because the real data is both variable in length and value and
            >also separated by spaces, the Find and ^T features won't work,
            >but, it sure sounds like the ^!Toolbar Cut and ^!Toolbar Paste
            >will do the trick.

            You might run into a problem using ^!MoveCursor since the spacing
            is different. *If* there are no spaces in your data, then this
            should do what you want. It will loop moving through the spaces
            till it does not see any and then get the word. See the ;comment
            about the Find to speed it up a little bit. (You might try
            changing ^!GetWord(1)$ to ^$GetBlock(1)$.

            <--- Copy below this line --->
            H=GetCol 4 MichaelLaF
            ; Last Updated 08/08/2000, Sojourner@..., jody
            ^!SetHintInfo Working...
            ^!SetScreenUpdate Off
            ^!ClearVariable %List%
            ^!Jump 1

            :Start
            ^!Set %Word%=^$GetWord(1)$
            ^!Append %List%=^%Word%^%nl%
            ^!Jump Select_End

            :Loop
            ; If you know the minimum # of spaces change the Find to that
            ^!Find " " S
            ^!If ^$GetRow$ = ^$GetLineCount$ DoWhat
            ^!MoveCursor +1
            ^!IfSame "^$GetChar$" "^%Space%" Skip_-2
            ^!Set %Word%=^$GetWord(1)$
            ^!Jump Select_End
            ^!Append %List%=^%Word%^%nl%
            ^!If ^$GetCol$ = ^$GetLineSize$ Next else Loop
            ^!Jump +1
            ^!Goto Start

            :DoWhat
            ^!Info ^%List%

            <--- Copy above this line, right --->
            <--- click over a Library, and --->
            <--- choose "Add from Clipboard" --->

            >I remembered the old programmers saying... "If
            >it just keeps getting more complex, your going about it the wrong
            >way."

            Or study more. ;)


            Happy Clip'n!
            Jody

            http://www.sureword.com/notetab

            Subscribe, UnSubscribe, Options
            mailto:Ntb-Clips-Subscribe@...
            mailto:Ntb-Clips-UnSubscribe@...
            http://www.egroups.com/group/ntb-clips
          • Jody
            Hi Michael, ... ; If you know the minimum # of spaces change the Find to that ^!Find S ^!If ^$GetRow$ = ^$GetLineCount$ DoWhat ^!MoveCursor +1 ^!IfSame
            Message 5 of 6 , Aug 8 11:52 AM
            • 0 Attachment
              Hi Michael,

              >^!MoveCursor 11

              ; If you know the minimum # of spaces change the Find to that
              ^!Find " " S
              ^!If ^$GetRow$ = ^$GetLineCount$ DoWhat
              ^!MoveCursor +1
              ^!IfSame "^$GetChar$" "^%Space%" Skip_-2

              Another thing you could do to speed it up is consider the number
              of characters in the data and go one less or so than the shortest
              one. Use that figure for your ^!MoveCursor so you might be
              looking at something like this:

              ^!Find " " S
              ^!If ^$GetRow$ = ^$GetLineCount$ DoWhat
              ^!MoveCursor +4

              The idea is to try to land the cursor in the word somewhere *w/o*
              overshooting it. Let's play target practice. <g> "Almost only
              counts in horseshoes" I am told.

              Happy Clip'n!
              Jody

              http://www.sureword.com/notetab

              Subscribe, UnSubscribe, Options
              mailto:Ntb-Clips-Subscribe@...
              mailto:Ntb-Clips-UnSubscribe@...
              http://www.egroups.com/group/ntb-clips
            • Michael LaFountain
              Thanks for all the help Jody, the ^!Toolbar Cut did just what I needed. The problem was caused by the ^!Keyboard Ctrl-X command just like i figured. With the
              Message 6 of 6 , Aug 8 12:18 PM
              • 0 Attachment
                Thanks for all the help Jody, the ^!Toolbar Cut did just what I
                needed. The problem was caused by the ^!Keyboard Ctrl-X command just
                like i figured. With the ^!Toolbar command, I can put NoteTab in the
                background and continue to work away on other things.

                Mike LaFountain
              Your message has been successfully submitted and would be delivered to recipients shortly.