require 'csv'
require 'json'
csv_table = CSV.parse(File.read(filename), headers: true,:col_sep => ';' )
@json_string = csv_table.map(&:to_h).to_json
@json_string = JSON.parse(@json_string)
@email=@json_string.map{|e| e["email"]}
@json_string=@email print(@json_string,"san")
csv file inside
email;Identifier;password;Recovery code;Fname;Lname;Department;Location
[email protected];9012;12se74;rb9012;Rachel;Booker;Sales;Manchester
[email protected];2070;04ap67;lg2070;Laura;Grey;Depot;London
[email protected];4081;30no86;cj4081;Craig;Johnson;Depot;London
[email protected];9346;14ju73;mj9346;Mary;Jenkins;Engineering;Manchester
[email protected];5079;09ja61;js5079;Jamie;Smith;Engineering;Manchester