From: Phillip Gawlowski Date: 2008-06-06T10:55:30+09:00 Subject: Re: Newbie question concerning ruby and mysql -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael Litchard wrote: | Hi, I'm taking this flat file and putting it into a mysql table. | The question is, given the code I will be working from, what's the Ruby way | to skip the first line? One option: irb(main):001:0> array = ["a","b"] => ["a", "b"] irb(main):002:0> array.delete array.first => "a" irb(main):003:0> array => ["b"] Works if you, for example, read a file in lines. And CSV/FasterCSV should have methods to skip a CSV header, too. And there is the csv2sql gem, which could help, too. - -- Phillip Gawlowski Twitter: twitter.com/cynicalryan Blog: http://justarubyist.blogspot.com ~ I imagine bugs and girls have a dim perception that nature played a cruel trick on them, but they lack the intelligence to really comprehend the magnitude of it. -- Calvin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhImUoACgkQbtAgaoJTgL8huwCgieVUF7t2c2JpvAL0rCXzX49c lecAn26sUKKzdBzJEKfK3zZt3V1iKeRl =FQwq -----END PGP SIGNATURE-----