Open and read file line by line tcl tk

set fhandle [open http://www.com r]

while {[gets $fhandle lyne] > -1} {
set stuff "[lindex $lyne 0] - [lindex $lyne 6]"
puts $stuff
}

exit

--------- Description ---------------------

The program above opens a file in Tcl and reads it line by line
(the two parameter varient of "gets" putting the line into the
variable named as the second parameter.
原文地址:https://www.cnblogs.com/greencolor/p/2031209.html