Forum Discussion
ldesfosses
Cirrus
Mar 26, 2018Access a table in the implemention
Hi,
I've a table that I don't know how to access.
It's received by the Implementation, if I print it :
puts "table $mytable"
I have this :
table {{
name lala
nodeaddr 8.5.2.1...
ldesfosses
Cirrus
Mar 26, 2018I've written this :
set tmpstring [string map {\{\{ \{} $mytable]
set mytable [string map {\}\} \}} $tmpstring]
foreach item $mytable {
set nextisname 0
set tmpitem [string trim $item]
foreach line [split $tmpitem] {
if { $line eq "name" } {
set nextisname 1
} else {
if { $nextisname eq 1 } {
puts "name $line"
set nextisname 0
}
}
}
}
Not my proudest code, but it allow me to access the value.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects