ios.each_line do |line|
unless line[0] == '#'
fields = line.chomp.split(delimiter)
- replace_hash[fields[options[:search_col] - 1]] = fields[options[:replace_col] - 1]
+ k = fields[options[:search_col] - 1]
+ v = fields[options[:replace_col] - 1]
+
+ raise RuntimeError, "duplicate key: #{k} found in file" if replace_hash.has_key? k
+
+ replace_hash[k] = v
end
end
end