Use GitHub Copilot in the command line.
pip uninstall gh
brew install gh
gh auth login
gh extension install github/gh-copilot
gh extension upgrade gh-copilot
gh copilot suggest 'read text file line by line and return the total number of alphanum chars in each line'
Suggestion:
while IFS= read -r line; do echo "$line" | tr -d -c '[:alnum:]' | wc -m; done < filename.txt