Home | Mirror | Search | ITEYE 博客 | OSChina 博客 | 51CTO 博客

第 11 章 Text Processing

目錄

11.1. iconv - Convert encoding of given files from one encoding to another
11.1.1. cconv - A iconv based simplified-traditional chinese conversion tool
11.2. 字元串處理命令expr
11.3. cat - concatenate files and print on the standard output
11.3.1. -s, --squeeze-blank suppress repeated empty output lines
11.4. nl - number lines of files
11.5. od - dump files in octal and other formats
11.5.1. 16進制
11.6. tr - translate or delete characters
11.7. cut - remove sections from each line of files
11.8. printf - format and print data
11.9. Free `recode' converts files between various character sets and surfaces.
11.10. /dev/urandom 隨機字元串
11.11. col - filter reverse line feeds from input
11.12. apg - generates several random passwords
11.13. head/tail
11.14. grep, egrep, fgrep, rgrep - print lines matching a pattern
11.14.1. 刪除空行
11.14.2. -v, --invert-match
11.14.3. Output control
11.14.3.1. -o, --only-matching show only the part of a line matching PATTERN
11.14.3.2. 遞歸操作
11.14.3.3. -c, --count print only a count of matching lines per FILE
11.14.4. Context control
11.14.4.1. -A, --after-context=NUM print NUM lines of trailing context
11.14.4.2. -B, --before-context=NUM print NUM lines of leading context
11.14.4.3. -C, --context=NUM print NUM lines of output context
11.14.4.4. --color
11.14.5. Regexp selection and interpretation
11.14.5.1. .*
11.14.5.2. 2010:(13|14|15|16)
11.14.5.3. []與{}
11.14.6. ^M
11.14.7. egrep
11.15. sort - sort lines of text files
11.15.1. 對列排序
11.16. uniq
11.17. 行列轉換,表格操作
11.17.1. column - columnate lists
11.17.2. paste - merge lines of files
11.18. 反轉字元串或檔案內容

11.1. iconv - Convert encoding of given files from one encoding to another

11.1.1. cconv - A iconv based simplified-traditional chinese conversion tool

cconv是建立在iconv之上,可以UTF8編碼直接轉換,並增加了詞轉換。

sudo apt-get install cconv
			

使用cconv進行簡繁轉換的方法為:

cconv -f UTF8-CN -t UTF8-HK zh-cn.txt -o zh-hk.txt