Find all files with the extension .txt and any name containing a number, and execute the command sed to replace all whitespace with the character 'g' in each of those files.
find ./ -name '*.txt' -a -iname '*[0-9]*' -exec sed -i 's/\s\+/g' {} +