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/archive/2011/04/27/2031209.html