From: Chad Perrin Date: 2008-11-16T10:38:13+09:00 Subject: Re: IO#lineno= doesn't work the way I expected --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 16, 2008 at 09:51:16AM +0900, Jens Wille wrote: > hi chad! Hi. >=20 > not sure what tim was suggesting, but this will work: >=20 > in_fh =3D File.open(infile, 'r') > out_fh =3D File.open(outfile, 'w') >=20 > # ignore first line > in_fh.gets >=20 > in_fh.each_line do |l| > out_fh << l > end >=20 > ok, it's not pretty, but not *that* ugly either, is it? ;-) Actually, that looks pretty good, all things considered. I didn't realize the IO#gets would increment the line number of the file so the each_line iterator would start on the second line. If that's how it works, I'm home free. Thank you for your help. I'll go test this now to make sure it works. --=20 Chad Perrin [ content licensed PDL: http://pdl.apotheon.org ] O'Rourke's Circumcision Precept: You can take 10 percent off the top of anything. --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkkfelMACgkQ9mn/Pj01uKV+yACgkEgraz7oQjW0iqiYZfPVIhAZ YBQAnAlqpJoPqhDpGNUmSCHhvm5xh+GQ =6r+Q -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--