Replace any line ending with an 8 or more character string of letters, numbers, or @ symbols with just that string in a randomly chosen .txt file in the current directory.
sed -i -e 's|.*([a-zA-Z@]{8,})$|\1|' $(shuf -n 1 $(find . -type f -iname '*.txt'))