Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing results in Excel.

Status
Not open for further replies.

prodtest

Technical User
Aug 29, 2003
55
GB
I have written a script which uses the command snapshot 32 times to store the results of what is on the screen to .txt documents. All works great but I have to store 32 different results. When the scipt ends it opens up all 32 .txt documents for me to check the results. Also it saves a lot of unnescary info of the screen as well.
Is it possible to just select data from three different lines from the screen and store these in different cells in an excel document ?
That way I will only require one excel file reather than 32 .txt documents to look at ?
Also if the script was run again would it over write the previous results with the new ones ?
Is it also possibly to get Procomm to open up a selected sheet in excel and print it ?
A lot of question !!! Hope some one can help me.
Cheers
 
If the information you are interested in is always in the same location, you could use the termgets command to read those lines and store each line into a separate string variable. You could then use DDE to send that information to an Excel spreadsheet (this would require that Excel was open and the spreadsheet loaded). I have some example code on my site that should give you some ideas to start with.


aspect@aspectscripting.com
 
Once you get your data from the file you can use the ddeinit, ddepoke, dderequest, to establissh the excel connection, send the information, and if you want to test to make sure you sent the info.
As far as overwriting the file that depends on how you wrote the script. If you wrote the script to save the files with the same name then your info will be overwritten.
I know in procomm you can select a specific sheet and the only way I know to print it is to send the keys ALT F then send Key P.
Not sur ehow you would get around having to hit enter after ward though.

To go where no programmer has gone before.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top