thanq ulis.
can anyone give me a simple syntax for getting the index of the number of line in the file. suppose I want to fetch the first string of the 3rd line in the file!! I used the following code.
# This is to fetch the data from the file into the window
set path [format "/xwinnmr/tcl/xwish_scripts/iu_acqu.txt"]
set file [open $path r]
foreach line [split [read $file] \n] {
set index [string range [lindex $line 0] 0 end]
set freq1 [string range [lindex $line 1] 0 end]
set time1 [string range [lindex $line 2] 0 end]
}
close $file
this way it's fetching the strings only from the last line. so wat to do if I want to get acess to the ith line?
thanks in advance.