>>837
Ruby では、オプションに変換関数・converter を指定できる

require 'csv'

input_csv = <<"EOT"
2022-10,あ,100
2023-01,い,200
EOT

require 'date'

# 月をDate 型へ、金額を整数型へ変換する
proc = Proc.new do |field, field_info|
case field_info.index # 列のインデックス
when 0 then Date.strptime( field, "%Y-%m" )
when 2 then field.to_i
else
field # 処理なし
end
end

options = { :converters => proc }

CSV.parse( input_csv, options ).each { |row| p row }

出力
[#<Date: 2022-10-01 ((2459854j,0s,0n),+0s,2299161j)>, "あ", 100]
[#<Date: 2023-01-01 ((2459946j,0s,0n),+0s,2299161j)>, "い", 200]