Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-09-2013, 12:08 PM
ebarb's Avatar
ebarb ebarb is offline
Registered User
 
Join Date: Oct 2012
Location: Springfield, MO
Posts: 5
Send a message via Skype™ to ebarb
Post Discussion of "Example: Integrating with Microsoft Excel" script

In reference to this example script: Integrating with Microsoft Excel...

Is there a way to look for specific output after a command is run and indicate that into a specific column or log parts of that into a specific column?

Last edited by jdev; 12-04-2017 at 11:07 AM.
Reply With Quote
  #2  
Old 10-09-2013, 12:34 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,191
Hello ebarb,

Yes, see lines 135-138 of the example Reading and Writing script.

If I understand correctly what you want to do, you could use InStr() to check strResults for the desired output and base your success/fail flag on that.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by jdev; 12-04-2017 at 11:11 AM.
Reply With Quote
  #3  
Old 01-10-2017, 11:15 AM
tpaolillo tpaolillo is offline
Registered User
 
Join Date: Jan 2017
Posts: 10
Write entire results to excel

Hi bgagnon, These are great examples. I'm looking to write the results my a sent command to the excel sheet not just "Success" or "Fail". Would you happen to have any examples of that?

Thanks

Last edited by jdev; 12-04-2017 at 11:10 AM.
Reply With Quote
  #4  
Old 01-10-2017, 12:18 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,191
Hi Tony,

You can use that same example script. You would just set objCell.Value to strResults instead of adding the info as a comment. See the If/Then/Else code block beginning at line 152.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by jdev; 12-04-2017 at 11:10 AM.
Reply With Quote
  #5  
Old 01-10-2017, 02:28 PM
tpaolillo tpaolillo is offline
Registered User
 
Join Date: Jan 2017
Posts: 10
Hi bgagnon, Attached is the results of the command to the tank monitor. You can see there will be multiple lines for each site. This might be more complicated than I thought.
Attached Files
File Type: txt crt.Log.txt (552 Bytes, 111 views)
Reply With Quote
  #6  
Old 01-10-2017, 03:18 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,191
Hi Tony,

It seems you have several posts scattered about trying to address one specific task of your overall, "big picture" objective.

Would you take a minute to explain what you are trying to accomplish?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #7  
Old 01-10-2017, 07:10 PM
tpaolillo tpaolillo is offline
Registered User
 
Join Date: Jan 2017
Posts: 10
Hi bgagnon,
My big picture is to log onto a Veeder Root System via telnet thru port 6001 and send CTRL A 200 command. Then record the results to a excel file.
The excel file will be similar to the file I attached .

So basically the script will read the IP Addresses and ports from a excel file to connect to. Then it connects and sends the CTRL A 200 command and then records what the response is and moves onto the nest IP Address.

I was trying to piece something together with the samples but each sample has so many other options and I get lost in them.

Does that make sense?

Thanks
Tony
Attached Files
File Type: txt crt.Log.txt (552 Bytes, 89 views)
Reply With Quote
  #8  
Old 01-11-2017, 10:55 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,191
Hi Tony,

And you want the entire process automated?

From logon through writing to the Excel file?

I think the information about this being "CTRL A 200" command makes a difference. If I am not mistaken, somewhere in another post, you had listed that as just a literal string of "200".

If by that you mean you hold Ctrl+A, then type 200 in the terminal window when doing this manually, you will probably need to use the SendKeys() method to send the Ctrl+A.

If you are not in a huge hurry for results, I am willing to help you with your script in free cycles (as we do not write custom scripts), but can we take this out of the forums and correspond via regular email? (It's just a bit easier from a thread management standpoint.)

If so, please email support@vandyke.com and include "Attn Brenda - Forum Thread #10858" in the subject line.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #9  
Old 01-13-2017, 10:19 AM
tpaolillo tpaolillo is offline
Registered User
 
Join Date: Jan 2017
Posts: 10
Hi bgagnon, Thank you for your help.
Attached is the script I use not to retrieve the CTRL A 200 results. If you want I can send you in a private message the IP Address for a site that you can test and see the results I'm speaking about then you might get a better understanding.

The script I have runs thru a file of IP Addresses and sends back the results on screen but instead id like it to log the info to a excel file.
And I'm not in a hurry and really appreciate any help you would be willing to offer.

Tony
Attached Files
File Type: txt ATGConnect.vbs.txt (1.2 KB, 114 views)
Reply With Quote
  #10  
Old 01-13-2017, 03:33 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,191
Hi Tony,

Thanks for the offer but no, I cannot connect to your equipment.

I am a little confused though, because it seems like you are really close. I don't know why you need this additional script you attached. The Excel script example includes code to make the connection. It seems all you would need to do is place the IP addresses from your file into the Excel spreadsheet.

Then, to write the results to the Excel file, make the change I explained earlier in this thread. You should be able to paste multi-line data into a cell and it will resize as needed. If not, you can add code such as this to resize it:

objSheet.Columns("H:H").ColumnWidth = 250
objSheet.Columns("H:H").EntireColumn.AutoFit
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by jdev; 12-04-2017 at 11:10 AM.
Reply With Quote
  #11  
Old 01-14-2017, 09:00 AM
tpaolillo tpaolillo is offline
Registered User
 
Join Date: Jan 2017
Posts: 10
Hi bgagnon, I tried briefly to use the excel script and it didn't work but I will try again this weekend. I think I got lost in all the code at first. The script I attached does let me get the data back on the screen as needed but just need it to write to the file.
I will work on it this weekend and let you know.
Thanks again for all your help

Tony
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:45 AM.