Is there a way to skip the first line of a CSV file and make the second line act as the header?
I have a CSV file that has the date on the first row and the headers
I had the same problem (except I wanted to skip more than 1 line at the beginning) and came across this question while looking for a nice solution. For my case, I went with the code described in this answer to a similar question, except that I am also utilizing the headers option as you mentioned you wanted to do.
CSV.parse(File.readlines(path).drop(1).join, headers: true) do |row|
# ... now I can use: row['column_name']
end