Find all files that have been modified in the last 300 minutes, excluding those with the .txt extension, and execute the command "sed -i 's/\(.*\)/\U\1/g' {} +" on them.
find . -type f -mmin -300 ! -name '*.txt' -exec sed -i 's/\(.*\)/\U\1/g' {} +