Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/ruby
- #Script used to add base TAG data
- require 'rubygems'
- require_gem 'activerecord'
- require 'faster_csv'
- ActiveRecord::Base.establish_connection(
- :adapter => "oci",
- :host => "192.189.31.79/xe",
- :username => "prep",
- :password => "prep"
- )
- class Callerdescription < ActiveRecord::Base
- set_table_name "pco_callerdescription"
- end
- cnt = 1
- puts "Beginning to process..."
- #First get the Senate members
- FasterCSV.foreach('Extlist.csv') do | row |
- if cnt > 1
- if row[2] != nil
- description = Callerdescription.new
- description.callernumber = row[0]
- description.description = row[1]
- description.save
- end
- end
- cnt += 1
- end
- puts "#{cnt} records processed..."
Add Comment
Please, Sign In to add comment