From: Zoltar Speaks Date: 2007-11-03T00:43:34+09:00 Subject: Re: CSV with Ruby Newbie Wayne Magor wrote: > >> So how would i go about displaying the headers above each row then? > > The header variable is just an array of strings, so you can just print > header[0],header[1] and so on, but they won't line up with the data > you're printing from the rows. You should be able to figure out the > width of each data item. > > The way it's being printed doesn't correspond to the headers any longer, > so you would have to make up your own headers. Something like this: > > printf "%20s %7s %s\n\n", header[1], header[2], "Is it a special" Ok brilliant that makes sense. Thanks alot for your help! Pete -- Posted via http://www.ruby-forum.com/.