o = [] c = 0 out = STDOUT while p = ARGF.read(10) do o << p if c % 5 == 0 out.puts " " * 8 << o.join(" " * 3) o = [] end if c % 50 == 0 out.puts " " * 80 << (c.to_i * 10).to_s end c += 1 end out.puts " " * 80 << (c.to_i * 10).to_s