$ mkdir utf8
$ find . -name '*.html' | xargs -i iconv -f cp936 -t utf8 {} -o utf8/{}
$ perl -nle 'if (/<!--bodybegin-->/ .. m(<!--bodyend-->)){print}' 13957672.html
$ find . -name '*.html' | xargs -i sed -i 's/<font color=E6E6DD> www\.6park\.com<\/font>//g' {}
下面的命令不成功
$ find . -name '*.html' -exec iconv -f cp936 -t utf8 {} -o utf_{} \;
for i in *.html; do iconv -f "GBK" -t "UTF-8" -o "utf8"$i $i; done
mac osx 系统自带的iconv没有-o选项
https://askubuntu.com/questions/303222/apply-iconv-to-all-of-the-files-in-a-directory
Batch convert latin-1 files to utf-8 using iconv
make iconv replace the input file with the converted output
没有评论:
发表评论