/ =~ line
line.gsub!(/<[^>]+>/, '')
esc_line = CGI.unescapeHTML(line)
f.write esc_line
end
end
require 'cgi/util' htmlfile = 'nisendouka.html' textfile = 'nisendouka.txt' html = File.read(htmlfile) File.open(textfile, 'w') do |f| in_header = true html.each_line do |line| if in_header && /