On Oct 16, 2007, at 11:12 PM, Ben Giddings wrote:

> On Oct 17, 2007, at 00:05, John Joyce wrote:
>> as you iterate each line:
>> line.chop!.chop! + "\n"
>
> You don't want to use chop! unless you're trying to modify line.   
> If you really wanted to use chop! you'd use it like:
>
> line.chop!
> line.chop!
> line =+ "\n"
>
> If you want to chain them, you probably want line.chop.chop + "\n".
>
> In any case, it's safer to use the regexp because you don't know if  
> there's extra whitespace, what the end-of-line chars look like, etc.
>
> Ben
>
>
Uh, yeah, that's why you should test it.
Regex is great if you want to do all of that. Tend to be more intensive.

Pretty easy to determine EOL characters... that's what's determining  
the lines already, OP did refer to lines as 'records'

OP wants to modify the lines.

Lines of something like a log file will be consistent..
but like I said, quick and dirty.