I have this data
# Curve 0 of 2, 7 points
# x y xlow xhigh type
20.781 1 20.781 20.781
20.8102 10 20.8102 20.8102
20.8395 18 20.8395 20.8395
20.8687 13 20.8687 20.8687
20.898 15 20.898 20.898
20.9273 18 20.9273 20.9273
20.9565 13 20.9565 20.9565
# Curve 1 of 2, 7 points
# x y xlow xhigh type
21.635 2 21.635 21.635
21.6625 19 21.6625 21.6625
21.6899 29 21.6899 21.6899
21.7173 63 21.7173 21.7173
21.7447 137 21.7447 21.7447
21.7721 168 21.7721 21.7721
21.7996 109 21.7996 21.7996
All the information is an unique file, i.e block data are separated by three blank lines. I want to collect the information that is just at the beginning of the next line that has characters # x y xlow xhigh type. Also I want to collect the information that is at the end of each block. In other words, I want to print on screen the values that are in bold letter (20.781 20.9565 21.635 21.7996).
I wrote these lines of code but I don't know how to print the info that is just below the characters # x y.
set input [open "dataHist.dat" r]
while { [gets $input line] != -1 } {
if { [string range 0 4] == "# x y"} {
}
}