写出脚本 xsh1 sed 让 ttxt 文件中非句号结尾的句子和下一行拼接2 because 在中间的行在because 前断开换行
#!/bin/bash
1. Join non-period ending sentences with the next line
sed -e ':a;N;$!ba;s/([^.])\n([^A-Z])/\1\2/g' t.txt > t1.txt
2. Break lines before "because"
sed -e 's/because/\n&/g' t1.txt > t2.txt
Cleanup
rm t.txt mv t2.txt t.txt rm t1.txt
echo "Done!"
原文地址: http://www.cveoy.top/t/topic/GHC 著作权归作者所有。请勿转载和采集!