Replace all strings of 1 to 50 characters with a string of 10 characters generated from the current date and time in the file.txt file.
sed -i 's/^[-@#$%.a-zA-Z0-9]\{1,50\}$/\$(echo "&$(date +%s | md5sum | cut -c1-10 | base64 -w0)")/' ./file.txt