On Wed, Jul 30, 2008 at 3:33 PM, Thomas Luedeke <thomas.luedeke / areva.com> wrote: > If I change "detailedModelModified.puts line" to "puts line" in my > coding, it works as intended. The problem is in the print to the > detailedModelModified file. > > I'll try your version and see if it works in my coding. Be back in a > minute. Actually, I didn't notice your nested ifs. This should be equivalent check_disabled = false File.open( "detailed_model_mod", "w" ) do |mod| File.foreach("detailed_model") do |line| if check_disabled || line =~ /^\s*[\*]/ mod.puts(line) check_disabled = true if line =~ /^\s*41/ end end end