I'm trying to check if a cell is empty because when the parser reaches an empty cell it throws NoMethodError (undefined methodvalue' for nil:NilClass)`
This is what I was trying to do:
1.upto(inventory[0].sheet_data.size) do |line|
@projectCode = inventory[0][line][1].value unless inventory[0][line][1].value.nil?
@ProjectName = inventory[0][line][2].value unless inventory[0][line][2].value.nil?
endalso tried
1.upto(inventory[0].sheet_data.size) do |line|
@projectCode = inventory[0][line][1].value unless inventory[0][line][1].value.empty?
@ProjectName = inventory[0][line][2].value unless inventory[0][line][2].value.empty?
endThe cells with values have no issues, but when it reaches 2 empty rows below all data it throws this... Can anyone tell me how to do this?