How do I parse through a csv file to check if a value exists in all the array in the csv file? And after just pull the array that contains the value and display it?
require 'csv'
########
## Ask for Serial number
########
serial_number = ask("Product serial number?", true)
serial_number = serial_number.to_s
serial_number = serial_number.upcase
stamp_date= Time.now
old = Time.now.to_i
###################
## CHECK if SN exist in Serial List
###################
CSV.foreach('procedures/Serial.csv') do |row|
check_serial = row[0]
require 'csv', then use the CSV class. Better you if can share some code if still stuck.CSV.parse. You check if a value exists with methods like==, orArray#include?(your description is somewhat unclear). You "pull the value that contains it" (??) with methods likeEnumerable#selectorEnumerable#find. There is insufficient information in your question for anyone to provide a full code sample, and you haven't shared any attempted solution - so I really don't know what answer you're looking for?