Talk:Tcl Programming/Working with files

I am trying to get content from a file and try to manipulate with the data in that.I used the following script for that.

set fp [open "/app/ess/appl/ess.version/exits/Tcl/out_exit6" r] set data [split $fp] foreach line $data { set rssUserNames [read $fp] puts $LogFile $rssUserNames }

The file contains 5 values.But i am not able to retrieve all 5.Instead i am getting only 3 values.How will i retrieve all data?