It may be that you are not exiting Excel correctly and that an instance of the
Excel object is still locking the file. Look in your task manager if there are
any instances of excel.exe after you have closed all the Excel windows. If this
is the problem you should use something like
Hi Margam
You should really read the Ruby documentation on accessing array elements.
Nevertheless, here is how I would do it:
require 'csv'
array = []
CSV::Reader.parse(File.open('gmail.csv')) do |row|
array row.join(',')
end
puts array[10].split(',')[1] # row 11 (column 2)
puts