Clovertech
› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Looping Through Lines of a File in Tcl
In perl you can easily loop through lines of a file like this …
Code: while () {
while () {
or even …
Code: while (<>) {
while (<>) {
Is there a way to do this in Tcl?
-- Max Drown (Infor)
Found this on the web. Seems to work.
Code: set f [open test.txt r] while {[gets $f line] != -1} { puts $line }
set f [open test.txt r]
while {[gets $f line] != -1} { puts $line }