I am in the process of writing a Tcl script that processes lines from a file and extracts specific information to format in a readable manner.
Some of the files contain hidden control characters or a single quote mark or a single brace. These need to be ignored so the string can be assigned to a string array location for processing. One character that turns up in the first line in a small percentage of files causes Tcl to think that no further data is in the line and provides error messages such as "Missing " when attempting to 'set each_line(1)' ....
I am pretty sure the control character is \u0003 'ETX'. This means that the script grinds to a halt and I can no longer process further files.
Is there any way I can get Tcl to ignore/replace or at least allow me to step over this file "logging it" and proceeding to process the next file.
I have already tried to use [string replace] and [catch]
to detect in advance to be able to move on to the next file but to no avail...
Any ideas?
Some of the files contain hidden control characters or a single quote mark or a single brace. These need to be ignored so the string can be assigned to a string array location for processing. One character that turns up in the first line in a small percentage of files causes Tcl to think that no further data is in the line and provides error messages such as "Missing " when attempting to 'set each_line(1)' ....
I am pretty sure the control character is \u0003 'ETX'. This means that the script grinds to a halt and I can no longer process further files.
Is there any way I can get Tcl to ignore/replace or at least allow me to step over this file "logging it" and proceeding to process the next file.
I have already tried to use [string replace] and [catch]
to detect in advance to be able to move on to the next file but to no avail...
Any ideas?