You solution is way too hard for the problem.
It looks lime you have a CVS (comma separated values) file.
Download the latest tcllib (tcllib.8, I think). One of the packages in there is a csv package. It will return a list of values for each line.
Use it, I think you will like it.
http://sourceforge.net/project/showfiles.php?group_id=12883&package_id=24585&release_id=363503
To download tcllib.8
Charlie