Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is an example of putting copied Excel data into an array.</p> <pre><code>MyClipBoard=%ClipBoard% ; Remove any non-text (format) data Loop, parse, MyClipBoard, `n,`r ; Place Excel content from clipboard in 2 dimentional Array { ; Start-Loop Read through each Line (record) in the ClipBoard data from Excel FullRecord:=A_LoopField ; Put a whole row in the variable FullRecord RecordNumber:=A_Index ; Store the current record (row) number. Loop, parse, FullRecord, %A_Tab% ; Parse the row content (FullRecord) in separate fields { ; Start-Loop Read through each Field in the ClipBoard data from Excel FieldNumber:=A_Index ; Store the current Field number. Array%RecordNumber%_%FieldNumber% := A_LoopField ; Array1_1 is Excel Row 1 column A, Array1_2 = Excel Row 1 column B } ; End-Loop Read through each Field in the ClipBoard data from Excel } ; End-Loop Read through each Line (record) in the ClipBoard data from Excel </code></pre> <p>If you need more examples to get you going, let me know.<br> OK here are some more examples, you could clean this up by looking at the examples in the other answers like using Variable++ instead of Variable +=1</p> <pre><code>; Read data from text file into one dimentional Array ArrayCount = 0 Loop, Read, %A_ScriptDir%\SearchTerms.txt ; This loop retrieves each line from the file, one at a time. { ArrayCount += 1 ; Keep track of how many items are in the array. Array%ArrayCount% := A_LoopReadLine ; Store this line in the next array element. } TextCounter = 1 IniWrite, %TextCounter%, C:\Temp\SearchTerms.ini, Counter, Nr ; Write counter in ini so I can restart at latest counter SearchText:= Array1 ; Put data from Array1 into variable SearchText MouseClick, left Send, %SearchText%{Enter} SplashTextOn, 200, 20,Searchterm,F%TextCounter% %SearchText% WinMove, Searchterm, , , 0 Return Browser_Favorites:: IniRead, TextCounter, C:\Temp\SearchTerms.ini, Counter, Nr ; Read latest counter TextCounter += 1 IniWrite, %TextCounter%, C:\Temp\SearchTerms.ini, Counter, Nr SearchText:=Array%TextCounter% ; Put data from Array+number into variable SearchText ; Examples with Array of 2 deep. MyClipBoard=%ClipBoard% ; Remove any non-text (format) data Loop, parse, MyClipBoard, `n,`r ; Place Excel content from clipboard in 2 dimentional Array { ; Start-Loop Read through each Line (record) in the ClipBoard data from Excel FullRecord:=A_LoopField ; Put a whole row in the variable FullRecord RecordNumber:=A_Index ; Store the current record (row) number. Loop, parse, FullRecord, %A_Tab% ; Parse the row content (FullRecord) in separate fields { ; Start-Loop Read through each Field in the ClipBoard data from Excel FieldNumber:=A_Index ; Store the current Field number. Array%RecordNumber%_%FieldNumber% := A_LoopField ; Array1_1 is Excel Row 1 column A, Array1_2 = Excel Row 1 column B } ; End-Loop Read through each Field in the ClipBoard data from Excel } ; End-Loop Read through each Line (record) in the ClipBoard data from Excel DLCounter:=1 DLSub:=1 DLData:=Array%DLCounter%_1 While (DLData &lt;&gt; "") { While (DLData &lt;&gt; "") { MsgBox, %DLData% DLSub += 1 DLData:=Array%DLCounter%_%DLSub% } DLSub:=1 DLCounter += 1 DLData:=Array%DLCounter%_%DLSub% } Return </code></pre> <p>It might not be the cleanest code, but it will give you an idea what you can do.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload