Hi there,
I would like to read out content from a text file into a list, look for a specific value, change it and write it back into the text file.
The problem is lappend doesn';t seem to what I expect, my code:
now my list stays always length 1 i assume that's from the set command...Any clues what I'm doing wrongly?
Suggestions and hints are appreciated!
Thank you!
Ron
Ron
Hours of planing can save weeks of coding
I would like to read out content from a text file into a list, look for a specific value, change it and write it back into the text file.
The problem is lappend doesn';t seem to what I expect, my code:
Code:
set path [file join C:/ "Documents and Settings" "FinalTest" "user.txt"]
set FileID [finaltest::retrieve $path r+ [clock seconds]]
# see if Operator list is existing already if so, wipe out name and add new
# one - if not, write whole new line "Operator=Name"
set userlst [list "user.txt"]
while {[eof $FileID]!=1} {
gets $FileID newline
#load file content into list
GUI::Info_DialogWIN "list length: [llength $userlst]\nappending: '$newline'"
lappend $userlst $newline
}
Suggestions and hints are appreciated!
Thank you!
Ron
Ron
Hours of planing can save weeks of coding