File word counter
lines = File.readlines("text.txt") line_count = lines.size text = lines.join puts "#{line_count} lines" word_count = text.split.length puts "#{word_count} words"