paragraph count
lines = File.readlines("text.txt") text = lines.join puts "#{line_count} lines" paragraph_count = text.split(/\n\n/).length puts "#{paragraph_count} paragraphs"