Forum Discussion
Problem with string map : TCL
Hi Team,
I test this two commands to replace $num with $num_fin in each ligneptf but with no result, the file isn't modified
string map -nocase [list $num $num_fin] $ligneptf
puts [string map -nocase [list $num $num_fin] $ligneptf]
if you have an idea , thank you in advance.
2 Replies
- Thomas_Gobet
Nimbostratus
Hi,
It should work but your problem may comes from that you didn't save this "new" variable. It replaces every occurrence but you have to save it manually.
For example what you can do is :
set new_ligneptf [string map -nocase [list $num $num_fin] $ligneptf]
- Ddib_147504
Nimbostratus
thank you, it works but it copies the line on the next line, can we replace the line directly in the same file without creating a new temp file?
Recent Discussions
Related Content
* 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