From: steven gre Date: 2012-05-29T06:41:02+09:00 Subject: Re: faster CSV writing Robert Klemme wrote in post #1062423: > On Mon, May 28, 2012 at 9:21 PM, steven gre > wrote: >> require 'nokogiri' >> phone= phone.gsub(/\n/,'') >> phone= phone.gsub(/ /,'') >> phone= phone.gsub(/\(/,' ') >> phone= phone.gsub(/\)/,'-') > > You could make you life easier by > - using String#gsub! > - combining regexps which have the same replacement > >> puts phone >> >> >> # Writing data into a csv file >> FasterCSV.open("test.csv", "w") do |csv| >> csv << [bname,phone] >> >> end >> > > And what exactly was your question? > > Regards > > robert trying to send all the data scraped to csv file business name, address, phone i either get all 1 record 1 row or just phone #'s and sometimes nothing been messing with this for some time, i'm a neub so this is probably most of the problem trying to make it each record row bname,addy,phone -- Posted via http://www.ruby-forum.com/.