Skip to content

Instantly share code, notes, and snippets.

@codethereforam
Last active December 1, 2019 12:06
Show Gist options
  • Save codethereforam/32c33ac0a288d37df0ba7c9bac625153 to your computer and use it in GitHub Desktop.
Save codethereforam/32c33ac0a288d37df0ba7c9bac625153 to your computer and use it in GitHub Desktop.
过滤掉每行不是英文单词的
# windows文件转Linux文件
dos2unix a.txt
# 处理并生成新文件(先trim每行)
cat a.txt | awk '{$1=$1;print}' | grep -E '^[A-Za-z]{2,}$' > b.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment