I am working on creating a program which stores users in a textfile, and would love to delete/modify a line based on a keyword. This is the code I have right now for searching a keyword, which in return will print the whole line containing the keyword:
keyword = File.readlines('skier_info.txt')
matches = keyword.select { |name| name[/#{search}/i] }
I'm wondering how I can use this small bit of code to write every line from the textfile over to a new one, except for the one line I get from the "matches" variable.