I was wondering if it is possible to parse a text file using TCL. For instance if I had the following in a file called file.txt:
-------------
Ryan,3453,
Jack,0,
Tom,8948,
blah,99,
-------------
And I wanted to pull just the numbers out as variables how would I go about that? With Linux I know I could use built in commands and exec and parse it that way like this:
set var [exec grep Ryan file.txt | cut -d, -f2]
But if I dont want to use a 3rd party utility could I parse the same file using just TCL? If so how would the syntax be?
Thanks for your time,
Ryan
-------------
Ryan,3453,
Jack,0,
Tom,8948,
blah,99,
-------------
And I wanted to pull just the numbers out as variables how would I go about that? With Linux I know I could use built in commands and exec and parse it that way like this:
set var [exec grep Ryan file.txt | cut -d, -f2]
But if I dont want to use a 3rd party utility could I parse the same file using just TCL? If so how would the syntax be?
Thanks for your time,
Ryan