I have a CSV file as following
ID Required -- these are headers
SD0005 Yes -- row information
I have to validate each row against header. Say ID contains letters and numbers and length should not be more than 6. Required header should be either yes or no in every row.
How can I achieve this functionality in Ruby if I have to process a huge file which has more than 1000 rows with good performance?
I'm reading particular row against each header as follows
CSV.foreach('file path', :headers => true) do |csv_obj|
csv_obj['ID']
csv_obj['Required']
Is there a way to know which condition failed while validating column against header for a row. I need to know for which condition it failed and print it out
New to ruby. Appreciate help