Beginner - need help for getting data from excel/word

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
jamestdsmith
Newbie
Posts: 3
Joined: Fri Jan 14, 2011 7:32 pm

Beginner - need help for getting data from excel/word

Post by jamestdsmith » Fri Jan 14, 2011 7:36 pm

Hi

Anyone able to help me. I'm a beginner and had a look on the forums, but not found anything as simple as me!

Every day I will be taking about 30 lines of text (either from excel, word or notepad, or an RSS feed, (using only one format, whatever is easiest).

I will then need to take each line of text and copy it, then paste into a subroutine in a different program.

I will then run a subroutine with this phrase,(I have this bit covered) and then will want to get the next phrase and do it again.

Can anyone help? if I cant get free help, I can create a scriptlance project for this. im desperate!

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Fri Jan 14, 2011 9:01 pm

Something like this should get you started.

Code: Select all

  Let>k=1
Label>start
  //Read a plain ASCII file created with notepad
  ReadLn>c:\temp\test.txt,k,line
  If>line=##EOF##,finish

  //Put contents of line on clipboard
  PutClipBoard>line

  //Paste the value from the txt file into some field
  //in another program which is currently running

  SetFocus>Put your application title here
  Wait>0.5
  //fill in the x and y coordinates for your other program
  MouseMoveRel>X,Y
  //Click in the field
  LClick
  Wait>0.5
  //Paste in the value stored on the clipboard
  Press Ctrl
  Send>v
  Release Ctrl

  //Get the next line in the txt file
  Let>k=k+1
  Goto>start
Label>finish

jamestdsmith
Newbie
Posts: 3
Joined: Fri Jan 14, 2011 7:32 pm

Post by jamestdsmith » Fri Jan 14, 2011 10:47 pm

wow, that is great. thank you so much.

One final question - not quite related to this.
I use the image capture feature to progress through a few screens. Sometimes, for whatever reason - it doesnt work and the screen will just stay the same in my process. Is there any way to add a line that says:
If the screen stays exactly the same for more than 5 minutes, then gotok=1
Label>start
//Read a plain ASCII file created with notepad
ReadLn>c:\temp\test.txt,k,line
If>line=##EOF##,finish

//Put contents of line on clipboard
PutClipBoard>line

//Paste the value from the txt file into some field
//in another program which is currently running

SetFocus>Put your application title here
Wait>0.5
//fill in the x and y coordinates for your other program
MouseMoveRel>X,Y
//Click in the field
LClick
Wait>0.5
//Paste in the value stored on the clipboard
Press Ctrl
Send>v
Release Ctrl

//Get the next line in the txt file
Let>k=k+1
Goto>start
Label>finish
[/code][/quote]

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts