It's a description
=begin
notes: I need to use readlines method....also I need to make a method that accepts user input or accepts a directory as an arg and maybe includes input validation to make sure that the directory includes "' '" or maybe easier include the single quotes in the method...
end
read_source_lines_from_file_to_a = File.read('C:\Users\demon002\text.txt').each_line.to_a
read_source_lines_from_file_to_a[5] = "test test inserted word test test"
File.open('C:\Users\demon002\text.txt', "w") do |inst|
inst.puts read_source_lines_from_file_to_a.to_s
end
File.read('C:\Users\demon002\text.txt')
=end
array_of_lines = IO.readlines('text.txt')
array_of_lines.each do |line|
line.gsub('word', 'insert word')
end
result = array_of_lines.join("\n")
IO.write('text.txt', result)