Browse Source

feat: set bom encoding for illness task as well

pull/2018/head
natdeanlewissoftwire 3 years ago
parent
commit
27a5ed1b6b
  1. 4
      lib/tasks/correct_illness_from_csv.rake

4
lib/tasks/correct_illness_from_csv.rake

@ -20,7 +20,9 @@ namespace :correct_illness do
raise "Usage: rake correct_illness:correct_illness_from_csv['csv_file_name']" if file_name.blank? raise "Usage: rake correct_illness:correct_illness_from_csv['csv_file_name']" if file_name.blank?
s3_service = Storage::S3Service.new(PlatformHelper.is_paas? ? Configuration::PaasConfigurationService.new : Configuration::EnvConfigurationService.new, ENV["IMPORT_PAAS_INSTANCE"]) s3_service = Storage::S3Service.new(PlatformHelper.is_paas? ? Configuration::PaasConfigurationService.new : Configuration::EnvConfigurationService.new, ENV["IMPORT_PAAS_INSTANCE"])
illness_csv = CSV.parse(s3_service.get_file_io(file_name), headers: false) file_io = s3_service.get_file_io(file_name)
file_io.set_encoding_by_bom
illness_csv = CSV.parse(file_io, headers: true)
illness_csv.each_with_index do |row, index| illness_csv.each_with_index do |row, index|
next if index < 3 next if index < 3

Loading…
Cancel
Save