Posted to tcl by venks at Tue Jun 26 03:53:29 GMT 2012view raw

  1. Slows down gradually to just crawling:
  2.  
  3.  
  4. while {[gets $fi line] >= 0} {
  5. incr linenum
  6. set line [string trim $line]
  7. if {$linenum % 1000 == 0} {
  8. puts -nonewline Read:$n:$linenum\r
  9. flush stdout
  10. }
  11. if {[string length $line] > 0} {
  12. set line1 "$line1 $line"
  13. if {[regexp {;$} $line] || [regexp {endmodule\s*$} $line]} {
  14. puts $fo $line1
  15. set line1 ""
  16. }
  17. }
  18. }
  19.  
  20.  

Comments

Posted by venks at Tue Jun 26 04:33:01 GMT 2012 [text] [code]

Fixed by changing the concat to a lappend + eventual join.