msguides/office 2016.txt

  1. File Existence Check:ruby if File.exist?('msguides/office 2016.txt') Checks if the file "msguides/office 2016.txt" exists.

  2. File Reading:ruby file_content = File.read('msguides/office 2016.txt') Reads the content of the file "msguides/office 2016.txt" and stores it in the variable file_content.

  3. String Replacement:ruby modified_content = file_content.gsub('old_text', 'new_text') Replaces occurrences of 'old_text' with 'new_text' in the file_content and stores the modified content in the variable modified_content.

  4. File Writing:ruby File.write('msguides/office 2016.txt', modified_content) Writes the modified content back to the file "msguides/office 2016.txt", effectively updating its content.

Note: Replace 'old_text' and 'new_text' with the actual values you want to replace in the file.