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

Cannot get Find and Copy clip to move past first instance

Expand Messages
  • Cliff Otto
    Hi, new to group and I haven t written any clips for a while, so I guess I ve gotten quite rusty. Anyway, I want to copy the line following the line that ends
    Message 1 of 4 , Nov 23, 2012
    • 0 Attachment
      Hi, new to group and I haven't written any clips for a while, so I guess I've gotten quite rusty. Anyway, I want to copy the line following the line that ends with

      BB SO

      Then, I want to copy the line that follows the next instance of a line ending with BB SO but everything I try ends up with the clip returning to the top of the document. The data would be like this:

      Game of 4/6/2012 -- Kansas City at Anaheim (N)

      Kansas City AB R H RBI Anaheim AB R H RBI
      Gordon A, lf 4 0 0 0 Aybar E, ss 4 1 1 3
      Cain L, cf 4 0 0 0 Kendrick H, 2b 4 0 1 0
      Hosmer E, 1b 4 0 0 0 Pujols A, 1b 3 0 0 0
      Butler B, dh 4 0 0 0 Hunter T, rf 4 0 1 1
      Francoeur J, rf 3 0 1 0 Wells V, lf 4 0 1 0
      Betancourt Y, 2b 3 0 1 0 Morales K, dh 3 0 1 0
      Moustakas M, 3b 3 0 0 0 Amarista A, pr 0 1 0 0
      Pena B, c 3 0 1 0 Trumbo M, 3b 3 1 1 0
      Escobar A, ss 3 0 1 0 Callaspo A, 3b 0 0 0 0
      Iannetta C, c 3 1 1 0
      Bourjos P, cf 3 1 2 1
      -- -- -- -- -- -- -- --
      31 0 4 0 31 5 9 5

      Kansas City 000 000 000 -- 0
      Anaheim 000 000 05x -- 5

      Kansas City IP H R ER BB SO
      Chen B 6.0 3 0 0 0 4
      Crow A (L) 1.1 3 3 3 0 3
      Holland G 0.2 3 2 2 1 1

      Anaheim IP H R ER BB SO
      Weaver J (W) 8.0 4 0 0 0 10
      Downs S 1.0 0 0 0 0 1

      E -- Trumbo M 2
      DP -- Kansas City 2
      LOB -- Kansas City 4, Anaheim 3
      2B -- Kendrick H, Francoeur J
      3B -- Aybar E
      CS -- Bourjos P
      WP -- Chen B
      T -- 2:22
      A -- 44106
      Game of 4/7/2012 -- Kansas City at Anaheim (D)

      Kansas City AB R H RBI Anaheim AB R H RBI
      Gordon A, lf 4 0 0 0 Aybar E, ss 4 0 0 0
      Cain L, cf 4 1 1 1 Kendrick H, 2b 3 0 1 0
      Hosmer E, 1b 5 2 2 1 Iannetta C, c 0 0 0 0
      Butler B, dh 4 0 1 0 Pujols A, 1b 4 0 1 0
      Francoeur J, rf 4 0 2 2 Morales K, dh 4 2 4 0
      Betancourt Y, 2b 3 0 1 0 Hunter T, rf 4 1 2 0
      Getz C, 2b 1 1 1 0 Abreu B, lf 3 0 1 2
      Moustakas M, 3b 4 1 1 1 Wells V, cf 4 0 0 1
      Quintero H, c 3 1 2 0 Callaspo A, 3b 3 0 0 0
      Escobar A, ss 3 0 1 0 Wilson B, c 1 0 0 0
      Izturis M, ph-2b 1 0 0 0
      -- -- -- -- -- -- -- --
      35 6 12 5 31 3 9 3

      Kansas City 210 011 010 -- 6
      Anaheim 000 000 201 -- 3

      Kansas City IP H R ER BB SO
      Hochevar L (W) 6.1 5 2 2 2 4
      Collins T 0.2 1 0 0 0 1
      Holland G 1.0 1 0 0 0 1
      Broxton J 1.0 2 1 1 0 0

      Anaheim IP H R ER BB SO
      Haren D (L) 5.1 11 5 5 1 5
      Takahashi H 1.0 0 0 0 0 1
      Isringhausen J 0.2 0 0 0 0 1
      Hawkins L 1.0 1 1 0 1 1
      Thompson R 1.0 0 0 0 0 1

      And I should get a list covering the entire season like this (probably double-spaced, but that is no problem):

      Chen B 6.0 3 0 0 0 4
      Weaver J (W) 8.0 4 0 0 0 10
      Hochevar L (W) 6.1 5 2 2 2 4
      Haren D (L) 5.1 11 5 5 1 5

      I tried moving the cursor forward in the copy loop and the main loop but I still cannot get the clip to function the way I want. Any suggestions? Thanks.



      [Non-text portions of this message have been removed]
    • Axel Berger
      ... ^!Set %tmpf%= ^$ExpandEnv( %temp% )$ 00A.CSV ^!DeleteFile ^%tmpf% ^!Jump TEXT_START ... ^!Find BB SO R(.+ R) RSTI1 ^!IfError finis ^!AppendToFile
      Message 2 of 4 , Nov 23, 2012
      • 0 Attachment
        Cliff Otto wrote:
        > I want to copy the line that follows the next instance of
        > a line ending with BB SO

        ^!Set %tmpf%="^$ExpandEnv("%temp%")$\00A.CSV"
        ^!DeleteFile ^%tmpf%
        ^!Jump TEXT_START
        :loop
        ^!Find "BB SO\R(.+\R)" RSTI1
        ^!IfError finis
        ^!AppendToFile "^%tmpf%" ^$GetSelection$
        ^!Goto loop
        :finis
        ^!Open "^%tmpf%"

        Axel
      • Cliff Otto
        Axel, thank you very much for solving my problem so quickly, although I cannot say that I understand ^!Find BB SO R(.+ R) RSTI1 . But your method did find
        Message 3 of 4 , Nov 23, 2012
        • 0 Attachment
          Axel, thank you very much for solving my problem so quickly, although I cannot say that I understand "^!Find "BB SO\R(.+\R)" RSTI1". But your method did find the 4,860 lines out of the 107,728 total in my data. Now I have about 100 more seasons to parse.

          Cliff

          To: ntb-clips@yahoogroups.com
          From: Axel-Berger@...
          Date: Fri, 23 Nov 2012 22:46:04 +0100
          Subject: Re: [Clip] Cannot get Find and Copy clip to move past first instance


























          Cliff Otto wrote:

          > I want to copy the line that follows the next instance of

          > a line ending with BB SO



          ^!Set %tmpf%="^$ExpandEnv("%temp%")$\00A.CSV"

          ^!DeleteFile ^%tmpf%

          ^!Jump TEXT_START

          :loop

          ^!Find "BB SO\R(.+\R)" RSTI1

          ^!IfError finis

          ^!AppendToFile "^%tmpf%" ^$GetSelection$

          ^!Goto loop

          :finis

          ^!Open "^%tmpf%"



          Axel
















          [Non-text portions of this message have been removed]
        • flo.gehrke
          ... No loopings needed here. Try... ^!SetClipboard ^$GetDocListAll( (?
          Message 4 of 4 , Nov 24, 2012
          • 0 Attachment
            --- In ntb-clips@yahoogroups.com, Cliff Otto <ottoc@...> wrote:
            >
            > And I should get a list covering the entire season like this
            > (probably double-spaced, but that is no problem):
            >
            > Chen B 6.0 3 0 0 0 4
            > Weaver J (W) 8.0 4 0 0 0 10
            > Hochevar L (W) 6.1 5 2 2 2 4
            > Haren D (L) 5.1 11 5 5 1 5
            >
            > I tried moving the cursor forward in the copy loop...

            No "loopings" needed here. Try...

            ^!SetClipboard ^$GetDocListAll("(?<=BB SO\r\n).+$";$0\r\n)$
            ^!Toolbar Paste New

            Regards,
            Flo
          Your message has been successfully submitted and would be delivered to recipients shortly.