0
這是我從CSV導入的當前耙子任務,我可以重寫它來導入並刪除兩個以前的列/將數據連接成一個latlon列,使用空格作爲分隔符?合併點數據列經緯度合併爲一個latlon
require 'csv'
desc "Import public library data from csv file"
task :import => [:environment] do
namespace :import_incidents_csv do
task :create_incidents => :environment do
ActiveRecord::Base.connection.execute "COPY PublicLibraryBranchLocations (DistrictNumber, DistrictName, LibrarySystem, Type, Branch, Phone, Email, Website, PhysicalAddress, City, Province, PostalCode, Latitude, Longitude) FROM '/home/mgmacri/data/PublicLibraryBranchLocations.csv' DELIMITER ',' CSV;"
end
end
end
到目前爲止,這一切都很有意義,我今天要測試,可能會有一些問題。謝謝! –
完全感謝一羣Guedes! –
不錯!不用謝! :) – Guedes