Hi, as you have probably already guessed from my question, I am fairly new to programming and brand new to TCL/TK.
I am trying to write a TCL program which will read in a file, one line at a time, into an array. Once that line is read into the array, I would then need to use the 'array size' function to "count" the number of elements in the array. After I know how many elements are in the array, I would then want to address each element individually. Checking for whether that character is a letter, a number, a space or a symbol. I would then report my findings on the screen,
i.e. There were 6 A's in the file
There were 5 a's in the file
There were 12 .'s in the file....
It is quite possible that there is a much easier way to accomplish this without using an array. Is it possible to read a file one character at a time? If it is, this, along with some strategically-placed nested loops, would also accomplish the task.
Thank You for you time and consideration.
I am trying to write a TCL program which will read in a file, one line at a time, into an array. Once that line is read into the array, I would then need to use the 'array size' function to "count" the number of elements in the array. After I know how many elements are in the array, I would then want to address each element individually. Checking for whether that character is a letter, a number, a space or a symbol. I would then report my findings on the screen,
i.e. There were 6 A's in the file
There were 5 a's in the file
There were 12 .'s in the file....
It is quite possible that there is a much easier way to accomplish this without using an array. Is it possible to read a file one character at a time? If it is, this, along with some strategically-placed nested loops, would also accomplish the task.
Thank You for you time and consideration.