lib/sushi_fabric/sushiApp.rb in sushi_fabric-0.6.0 vs lib/sushi_fabric/sushiApp.rb in sushi_fabric-0.6.1

- old
+ new

@@ -1,8 +1,8 @@ #!/usr/bin/env ruby # encoding: utf-8 -# Version = '20160715-153019' +# Version = '20160930-163938' require 'csv' require 'fileutils' require 'yaml' require 'drb/drb' @@ -475,21 +475,27 @@ file_path = File.join(@scratch_result_dir, @input_dataset_file) CSV.open(file_path, 'w', :col_sep=>"\t") do |out| headers = @dataset_hash.map{|row| row.keys}.flatten.uniq out << headers @dataset_hash.each do |row| - out << headers.map{|header| row[header]} + out << headers.map{|header| + val = row[header] + val.to_s.empty? ? nil:val + } end end file_path end def save_next_dataset_as_tsv headers = @result_dataset.map{|row| row.keys}.flatten.uniq file_path = File.join(@scratch_result_dir, @next_dataset_file) CSV.open(file_path, 'w', :col_sep=>"\t") do |out| out << headers @result_dataset.each do |row_hash| - out << headers.map{|header| row_hash[header]} + out << headers.map{|header| + val = row_hash[header] + val.to_s.empty? ? nil:val + } end end file_path end def copy_commands(org_dir, dest_parent_dir, now=nil)