On Feb 8, 3:25 pm, "oinkoink" <oinkoink+u...@rexx.com> wrote:
> require 'mathn'
> width = (Math.log((rl = IO.readlines("test.txt")).length)/
> Math.log(10)).floor + 1
> rl.each_with_index{ |line, k| print "%#{width}d. " % k + line}
Following up to myself, the idea is to keep from indenting the lines
differently
every time the line number passes a power of 10.
Regards, Bret