Hello all,
Is there any way so that I can read a .txt file which has alfa-numeric number in each line as below and assign it to variable, and then i have to SEND variable (every line ) .
Actually this is an excel column but to make things easy i paste in the .txt file.
QWER1234
QVER6432
ASDF7654
....
....
....
....
copy excel value one by one and paste to another programe
Started by
sam123
, May 11 2009 04:06 PM
14 replies to this topic
#1
-
Posted 11 May 2009 - 04:06 PM
Does each cell have to have its own unique variable for its data or can you re-use the same one for each copy from Excel/paste to another program?
#2
-
Posted 11 May 2009 - 04:11 PM
Thanks for reply.
here is the script i m using now. I need to read the number from .txt or excel file . and SEND to the place of ------- in the script belowthere are around 500 numbers . and i wish the whole process run autometically.
I thin it doesn't mattter if i use same variable or different variable for each line. I thin to use Array but I am new to this.
#space::IfWinExist Citrix1
Send F
-----
send {NumpadEnter}
send M
Send {Tab}
Send {Tab}
Send PGS Baeake
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
send {NumpadEnter}
send F
here is the script i m using now. I need to read the number from .txt or excel file . and SEND to the place of ------- in the script belowthere are around 500 numbers . and i wish the whole process run autometically.
I thin it doesn't mattter if i use same variable or different variable for each line. I thin to use Array but I am new to this.
#space::IfWinExist Citrix1
Send F
-----
send {NumpadEnter}
send M
Send {Tab}
Send {Tab}
Send PGS Baeake
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
Send {space}
send {NumpadEnter}
send F
#3
-
Posted 11 May 2009 - 04:21 PM
If you want to copy one number from Excel and move it over to the Citrix window you can run this (which I've modified a little to condense down your code):
If you need to copy a whole series of things before you go to the other program and paste them I'm sure we can look into a loop that can copy all of them, something like this:
Send ^c ClipWait Send {ENTER 2} ; sends ENTER twice, which goes to the next cell below WinWait, Citrix1 WinActivate, Citrix1 Send F[color=red]^v[/color]{NumpadEnter}M{Tab [color=red]2[/color]}PGS Baeake{space [color=red]20[/color]}{NumpadEnter}F return
If you need to copy a whole series of things before you go to the other program and paste them I'm sure we can look into a loop that can copy all of them, something like this:
Loop, 20 ; loops 20 times if you need to copy 20 spreadsheet cells, for example { Send ^c ClipWait Send {ENTER 2} ClipText .= Clipboard "`n" ; appends the current contents of the Clipboard followed by a linefeed(`n, which moves to a new line) to a variable Clipboard = ; empties the Clipboard before the next loop } Clipboard := ClipText ; saves the contents of the variable ClipText to the Clipboard
#4
-
Posted 11 May 2009 - 06:05 PM
thank you very much. I really appreciate your help. i will try this tommorow at work .
In the case this will not work what if i want to use .txt file which has all the numbers in seperate line. i think processing text file would be easy because the excel file is locked and when i pressed down arrow manually it doesnt go in to the next down cell. so if u write some code for .txt it would be great.
AAA125545
ABD127635
SWH652522
....
....
....
(500)
In the case this will not work what if i want to use .txt file which has all the numbers in seperate line. i think processing text file would be easy because the excel file is locked and when i pressed down arrow manually it doesnt go in to the next down cell. so if u write some code for .txt it would be great.
AAA125545
ABD127635
SWH652522
....
....
....
(500)
#5
-
Posted 11 May 2009 - 06:16 PM
I'm also really interested in this.
I have a spreadsheet that is a 7 x 128 table.
I'd like to have autohotkey copy the certain cells and paste them into another program I use, called midi-ox,
I've been doing it manually for about 5 hours now and am only about 15% through.
I'm new, but I'm not looking for the code to be given to me, just how I might structure this
thanks
I have a spreadsheet that is a 7 x 128 table.
I'd like to have autohotkey copy the certain cells and paste them into another program I use, called midi-ox,
I've been doing it manually for about 5 hours now and am only about 15% through.
I'm new, but I'm not looking for the code to be given to me, just how I might structure this
thanks
#6
-
Posted 25 May 2009 - 11:34 PM
I've been perusing the sight and have learned that when people are serious about being helped, they break down what the macro they are desiring does, step by step. Also, I'll attached some screenies to help visualize:
A) Check excel spreadsheet, "Chords by more" and look up cell B1. This value we'll call the "trigger".
http://www.theflipsi...ach=12651;image
Copy this value to the clipboard
C) Open up the application Midi-Ox
D) Click the Insert button in Midi-Ox (see green arrow in screenie2)
http://www.theflipsi...ach=12652;image
E) In new dialogue box, paste the copied value into the 3rd and 4th fields (labeled min and max values)
F) go back to the excel spreadsheet
G) go down one cell
H) Copy that value (I call this second value down the contrabass value)
I) Go back to midi-ox
J) In the dialogue box, click on the "Pass original value (clone) check box so it is checked
K) Also in the dialogue box, paste this second copied value, into the 10th and 11th fields
L) Ok the dialogue box
M) Repeat: go back, copy the trigger value again and paste each of the values for bass, baritone, tenor, etc...till there are no more values in the column
N) Now move over to the next column on the right, and repeat the whole thing again for this new trigger number
O) Stop when there are no more columns with data in excel
thanks in advance for any help. I hope my screenies come through but if not I hope I have supplied enough info
A) Check excel spreadsheet, "Chords by more" and look up cell B1. This value we'll call the "trigger".
http://www.theflipsi...ach=12651;image
Copy this value to the clipboard
C) Open up the application Midi-Ox
D) Click the Insert button in Midi-Ox (see green arrow in screenie2)
http://www.theflipsi...ach=12652;image
E) In new dialogue box, paste the copied value into the 3rd and 4th fields (labeled min and max values)
F) go back to the excel spreadsheet
G) go down one cell
H) Copy that value (I call this second value down the contrabass value)
I) Go back to midi-ox
J) In the dialogue box, click on the "Pass original value (clone) check box so it is checked
K) Also in the dialogue box, paste this second copied value, into the 10th and 11th fields
L) Ok the dialogue box
M) Repeat: go back, copy the trigger value again and paste each of the values for bass, baritone, tenor, etc...till there are no more values in the column
N) Now move over to the next column on the right, and repeat the whole thing again for this new trigger number
O) Stop when there are no more columns with data in excel
thanks in advance for any help. I hope my screenies come through but if not I hope I have supplied enough info
#7
-
Posted 26 May 2009 - 12:34 AM
can anybody help without the screenies? i thought I was pretty thorough
thanks
thanks
#9
-
Posted 27 May 2009 - 12:03 AM
I dont have the other application and am not interested in getting it
there are half a dozen COM based methods for workign with excel posted in the forum i wont repost those here
there are half a dozen COM based methods for workign with excel posted in the forum i wont repost those here
#11
-
Posted 27 May 2009 - 10:51 PM
Never lose.
WIN or LEARN.
WIN or LEARN.
outstretchedarm:
I would script this so that all the values in the excel spreadsheet were copied in one go and saved to variables, then move to the midi-ox program and paste what you need. That way you can set up a loop to move one column over each time.
something like:
You now have all the data from the first column of your spreadsheet saved as variables so you just need to activate the midi-ox window and use 'Click' and 'Send' to fill in the various input boxes.
When you've done that just activate the Excel window again, and copy the next line over.
I would script this so that all the values in the excel spreadsheet were copied in one go and saved to variables, then move to the midi-ox program and paste what you need. That way you can set up a loop to move one column over each time.
something like:
clipboard = ; empties the clipboard WinActivate, (name of excel window) Send, ^{Home}{Left}^c ; Copies cell B1 ClipWait, 1 StringTrimRight, trigger, clipboard, 2 ; copies the clipboard to the 'trigger' variable (minus the line break at the end) Loop { clipboard = Send, {Down}^c ; Copies Cell B2 ClipWait, 1 CellCheck := Clipboard ; This bit checks if the cell is empty StringSplit, CellCheck_, CellCheck, `n, %A_Space% %A_Tab% `n Length := StrLen(CellCheck_1) IfLessOrEqual, Length, 1 ; and if it is stops copying Break Else, StringTrimRight, value_%A_Index%, clipboard, 2 ; If the cell has a content it is copied to a variable (%A_Index% is the number of times the loop has run so each copied cell down will be one number higher) }
You now have all the data from the first column of your spreadsheet saved as variables so you just need to activate the midi-ox window and use 'Click' and 'Send' to fill in the various input boxes.
When you've done that just activate the Excel window again, and copy the next line over.
#12
-
Posted 28 May 2009 - 12:34 AM
Hi,
Just wondering if you could show an example of pasting the clipboard variables into notepad
Paste variable 1
Send {return}
Paste variable 2
Etc?
Just wondering if you could show an example of pasting the clipboard variables into notepad
Paste variable 1
Send {return}
Paste variable 2
Etc?
#15
-
Posted 31 March 2015 - 02:12 AM