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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expecting multiple lines, the moving output to a file

Status
Not open for further replies.

LilTCLer

Programmer
Nov 27, 2007
37
US
I am trying to read the contents of a memory map dump of learned unicast entries. Since the memory chunk is 1 million entries, I created an expect script to loop through the retreivals in 10,000 entry chunks. What I want to do is "read" this output into a file for post processing. I'm looking for help on "expecting" the output when the output from each "chunk" can be 10,000 lines.

here is a snipit of my loop:

set timeout 120
set beginIndex 0
for {set index 10000} {$index <= 1000000} { set index [expr {$index + 10000}] } {
cli_snd "mac-dram-print"
cli_rcv "Enter Start index:"
cli_snd "$beginIndex"
cli_rcv "Enter End Index:"
cli_snd "$index"
cli_rcv "Learning Database:"
cli_snd "2"

# Here is where I want to catch each of the 10,000 lines of data and add them to a file.
cli_rcv "psmon.iss.npapi"
set beginIndex [expr { $beginIndex + 10000 } ]
}


Any thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top