Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Array Not Pulling Any Information

$
0
0

I"m trying to create "1" array or more if needed to be able to pull very specific data from HTML page, while running in a loop to generate configuration commands for our team.  The problem that I am running into is....There are some portions of the configuration that will only need to be written 1 time no matter how many times the array is being looped for, while at other times I'll need all "6" instances of a particular variable written to a file one right after another.  

 

I believe that this is the correct way to create my array and gather the information but console write isn't displaying anything.  I"ve been reading all about _StringBetween and Arrays for about 3 weeks, and i've honestly gotten so much partial stuff working I've decided to start over.  The code below is the heart and soul of everything that I need to work off of though so if this doesn't work correctly everytime then there is no point in trying to work out the other stuff as well.

 

 

**Example of what i'm looking for at the end**

 

 

show bfd session summary
show log messages | last 300 

 

show interface extensive $asideinterface | no-more 
show interface diagnostics optics $asideinterface | match "Laser output power|Receiver signal average optical power"
 

show interface extensive $asideinterface | no-more 

show interface diagnostics optics $asideinterface | match "Laser output power|Receiver signal average optical power"

 

 

 

show interface extensive $asideinterface | no-more 

show interface diagnostics optics $asideinterface | match "Laser output power|Receiver signal average optical power"
 

 

****************************************************************************************************************************************************************

Below is my code.

 

As always any help is greatly appreciated

AutoIt         
#include <IE.au3> #include <string.au3> #include <Array.au3> $i = 0 Local $oIE = _IECreate("https://internal/mediawiki/index.php?title=C-ASHB/MRFD-01A-Q2-20135&action=edit", 0, 0, 1, 1) _IELinkClickByText($oIE, "Continue to this website (not recommended).") Local $imax = 26 Local $data = $oIE Local $string = _IEBodyReadHTML($oIE) _IEQuit($oIE) Local $projectnextstep = _StringBetween($string, '|NextStep=', @CRLF) Local $circuitID = _StringBetween($string, '|CircuitID=', @CRLF) Local $asideengineer = _StringBetween($string, '|ASideAssignedEngineer=', @CRLF) Local $zsideengineer = _StringBetween($string, '|ZSideAssignedEngineer=', @CRLF) Local $asidenextstep = _StringBetween($string, '|ASideNextStep=', @CRLF) Local $zsidenextstep = _StringBetween($string, '|ZSideNextStep=', @CRLF) Local $asiderouter = _StringBetween($string, '|ALocation=', @CRLF) Local $zsiderouter = _StringBetween($string, '|ZLocation=', @CRLF) Local $asideinterface = _StringBetween($string, '|AInterface=', @CRLF) Local $zsideinterface = _StringBetween($string, '|ZInterface=', @CRLF) Local $asidetransport = _StringBetween($string, '|ATransportLocation=', @CRLF) Local $zsidetransport = _StringBetween($string, '|ZTransportLocation=', @CRLF) Local $asidefpc = _StringBetween($string, '|AFPC=', @CRLF) Local $zsidefpc = _StringBetween($string, '|ZFPC=', @CRLF) Local $asidepic = _StringBetween($string, '|APIC=', @CRLF) Local $zsidepic = _StringBetween($string, '|ZPIC=', @CRLF) Local $asideoptics = _StringBetween($string, '|AOptics=', @CRLF) Local $zsideoptics = _StringBetween($string, '|ZOptics=', @CRLF) Local $asidetam = _StringBetween($string, '|ATAM=', @CRLF) Local $zsidetam = _StringBetween($string, '|ZTAM=', @CRLF) Local $asidetom = _StringBetween($string, '|ATOM=', @CRLF) Local $zsidetom = _StringBetween($string, '|ZTOM=', @CRLF) Local $asidetestip = _StringBetween($string, '|ATestingIP=', @CRLF) Local $zsidetestip = _StringBetween($string, '|ZTestingIP=', @CRLF) Local $bypassname = _StringBetween($string, '|BypassName=', @CRLF)  If IsArray($projectnextstep) Then      For $i = 1 to $projectnextstep[0]          ConsoleWrite($projectnextstep[$i] & @LF)          Next     For $i = 1 to $circuitID[0]          ConsoleWrite($circuitID[$i] & @LF)          Next     For $i = 1 to $asideinterface[0]          ConsoleWrite($asideinterface[$i] & @LF)          Next         For $i = 1 to $zsideinterface[0]          ConsoleWrite($zsideinterface[$i] & @LF)      Next      $i=$i +1  EndIf

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>