How to remove unwanted charecters using split in tcl

Posted by Mallikarjunarao on Stack Overflow See other posts from Stack Overflow or by Mallikarjunarao
Published on 2010-06-11T06:42:49Z Indexed on 2010/06/11 7:02 UTC
Read the original article Hit count: 193

Filed under:

Here is an example

Interface {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} IP-Address {} {} {} {} {} OK? Method Status {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {Protocol
FastEthernet0/0} {} {} {} {} {} {} {} {} {} {} {} unassigned {} {} {} {} {} YES unset {} administratively down down {} {} {} {
FastEthernet0/1} {} {} {} {} {} {} {} {} {} {} {} unassigned {} {} {} {} {} YES unset {} administratively down down

I want remove {} in this.
I assumed all the above string interface variable

set interface [string trimright [string trimleft $interface "{}"] "{}"]

but it doesn't work. How to remove the {} in my example?

© Stack Overflow or respective owner

Related posts about tcl