file.lines.each do |line| line.chars.each do |tok| # ... end end