Created
May 31, 2025 00:28
-
-
Save grahamhelton/632f2ce55ffbe8ba1e42694f563cbd22 to your computer and use it in GitHub Desktop.
Alias to remove emojis from a file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias remove-emojis='python3 -c " | |
import sys, unicodedata | |
with open(sys.argv[1], \"r\", encoding=\"utf-8\") as f: | |
text = f.read() | |
result = \"\".join(c for c in text if unicodedata.category(c) not in [\"So\", \"Sk\"]) | |
print(result, end=\"\") | |
"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment