Tomas Brixi wrote:

> Have some suggestion how to speed the ruby code?

You can check for the comment by
writing
next if line[0] == ?#

You can write
puts line
instead of
write line+"\n"
(Copies the string every time unnecessarily...)

Regards, Christian