I have a large list which I put in a file without any line break:
puts $output_file ", [format " %s" [join $elems ","]]"
however I need to insert a line break every 8 elements, since the resulting file is not interpreted correctly.
I wonder if there is some kind of built in function to do that?
If not I was thinking about a procedure returning a string with line breaks or a function writing to file every 8 elements.
anyone had the same problem?
Is there something like this in TCL : How do you split a list into evenly sized chunks?
thanks.