0

I am trying to filter specific information to variable via parsing the clipboard but I need some help doing this.

Loop, parse, clipboard, `n, `r
 {
If A_LoopField contains XYZ
;Copy whatever text is found 2 or 3 lines below into file but continue on.
 }

Here is an example of whats

Clipboard = (

  • Line 1 - Blank
  • Line 2 - XYZ Some text telling my script to copy line 4 and so on
  • Line 3 - Blank
  • Line 4 - "Text to be copied"
  • Line 5 - Blank
  • Line 6 - XYZ Some text telling my script to copy lines 8 and so on
  • Line 7 . . . )
4

1 回答 1

0

不确定这样的东西是否是您正在寻找的

cb =
(LTrim
    Line1
    Line2
    copy:5
    Line4
    Line5
    Line6
    copy:10
    Line8
    Line9
    Line10
    Line11
    Line12
)

copied := []    

Loop, parse, cb, `n, `r
{
    pos := (v:=strSplit(A_LoopField, ":")[2]) ? v:pos

    if (pos && A_Index >= pos){
        copied.push(A_LoopField)
    }
}

for k, v in copied
{
    msgBox % v
}
于 2017-06-24T09:53:47.680 回答