mercredi 1 décembre 2021

ruby I want to know the overlapping value by comparing the two excels

enter image description here

require 'roo'

require 'rainbow'

roo = Roo::Spreadsheet.open('./cause/jjjjob.xlsx') # excel 1

roo1 = Roo::Spreadsheet.open('./cause/jjjjob_2.xlsx') # excel 2

for i in 2..roo.column(2).length

for j in 2..roo1.column(1).length
    excel_2_peple = roo1.column(1)
    ss = roo.row(i)
    bb = roo1.row(j)
    ss.each_slice(2) do |name, job|
        if name == excel_2_peple
            puts Rainbow("same name = #{name}, excel_1 peple job #{job}  excel_2 peple job #{????}").green
        end
    end
end

end

Aucun commentaire:

Enregistrer un commentaire