Comment Comment by minor_nitwit that seems overly complicated for ruby if a is a file. c = []; a.lines{c << a.pos} As far as $, you may know it from Regex as the new line indicator. parent minor_nitwit 12 years ago