From: "Mitja Čebokli" Date: 2010-04-16T20:57:18+09:00 Subject: Re: DB to CSV Peter Hickman wrote: > Further hacking reveals that this might be a better option to create the > file. > > CSV.open("testfile.csv","w", ";") do |csv| > > Note we are no longer using the :col_sep => ";" notation but we do get > the ; > as a record / column separator. Hi, thanks a lot for your help. I have changed while r = dataset.fetch() rows << r.join("\n") end to while r = dataset.fetch() rows << r end and this now works as expected! No more problems about filling the CSV file. On the other hand, not using :col_sep is giving me an error: can't convert String into Integer (TypeError) Maybe the formatting of the line is wrong? One more question on this matter. How do I extract/use the table columns from the select file or if used as "select *" to extract all the column names, and than use them as a CSV header. Thanks again helping me out, really appreciate it! BR -- Posted via http://www.ruby-forum.com/.