 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Notw00tstick. Guest
|
Posted: Sun Oct 25, 2009 3:17 am Post subject: Parsing a clipboard with array rows? |
|
|
This is what I have
| Code: |
letters = ABCDEFGHIJKLMNOPQRSTUMWXYZ
StringSplit, letter, letters
Loop, Parse, ClipBoard, `,
data .= "Row " letter%A_Index% " = " (A_LoopField ? A_LoopField : "N/A") "`n"
Sendinput %data%
|
When I copy something like this:
| Quote: |
STOP,00270103,0x0001003B09ECC1C4,1991967974
|
This is the result I get when I type test1.
| Quote: |
Row A = STOP
Row B = 00270103
Row C = 0x0001003B09ECC1C4
Row D = 1991967974
|
I want to do 2 things to this.
One I want to alter row's to different names like
| Quote: |
Timer = STOP
Switch = 00270103
Hex = 0x0001003B09ECC1C4
Number = 1991967974
|
And second I want to only display certain rows that I want.
Like
| Quote: |
Timer = STOP
Hex = 0x0001003B09ECC1C4
|
Any help is appreciated. Thanks. |
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 1158 Location: San Diego, California
|
Posted: Sun Oct 25, 2009 5:26 am Post subject: |
|
|
To the end of your original script try adding this line
| Code: | | msgbox %letter3%%letter1%%letter20% |
BTW, You have a typo --->
| Quote: | letters = ABCDEFGHIJKLMNOPQRSTUMWXYZ
|
| Quote: | | One I want to alter row's to different names like | I think you need to read up more on this command to understand what it does: http://www.autohotkey.com/docs/commands/StringSplit.htm
Also check out this example from 'StringSplit' look at the listvars window that shows up, particularly the variables Colorarray1 .. 2.. 3 .
| Code: | Colors = red,green,blue
StringSplit, ColorArray, Colors, `,
Loop, %ColorArray0%
{
this_color := ColorArray%a_index%
MsgBox, Color number %a_index% is %this_color%.
}
listvars
msgbox | By reviewing the above example and reading, you can see how to create a list of alternate row names.
Hint: red & green aren't much different than Timer & Switch
Your original parsing loop could also store the useful data in an array, and using an index, you can retrieve the data in any order. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|