Posted to tcl by mjanssen at Thu Oct 25 01:07:50 GMT 2007view raw

  1. set re {^$}
  2. fconfigure stdout -encoding binary -translation binary
  3. foreach file $argv {
  4. set line 0
  5. set f [open $file r]
  6. fconfigure $f -encoding binary -translation binary
  7. while {[gets $f buf] >= 0} {
  8. if {[regexp -- $re $buf]} {puts $buf}
  9. }
  10. close $f
  11. }
  12.