RosettaCodeData/Task/File-input-output/Tcl/file-input-output-5.tcl

10 lines
233 B
Tcl

#open file for reading
set myfile [open "README.TXT" r]
#read something from the file
gets $myfile mydata
#show what was read from the file
#should print "This is line1, so hello world...."
puts $mydata
#close the file
close $myfile