Home | Mirror | Search

第 11 章 Text Processing

目錄

1. iconv - Convert encoding of given files from one encoding to another
1.1. cconv - A iconv based simplified-traditional chinese conversion tool
2. 字元串處理命令expr
3. cat - concatenate files and print on the standard output
3.1. -s, --squeeze-blank suppress repeated empty output lines
4. nl - number lines of files
5. od - dump files in octal and other formats
5.1. 16進制
6. tr - translate or delete characters
7. cut - remove sections from each line of files
8. printf - format and print data
9. Free `recode' converts files between various character sets and surfaces.
10. /dev/urandom 隨機字元串
11. col - filter reverse line feeds from input
12. apg - generates several random passwords
13. head/tail
14. grep, egrep, fgrep, rgrep - print lines matching a pattern
14.1. 刪除空行
14.2. -v, --invert-match
14.3. Output control
14.3.1. -o, --only-matching show only the part of a line matching PATTERN
14.3.2. 遞歸操作
14.3.3. -c, --count print only a count of matching lines per FILE
14.4. Context control
14.4.1. -A, --after-context=NUM print NUM lines of trailing context
14.4.2. -B, --before-context=NUM print NUM lines of leading context
14.4.3. -C, --context=NUM print NUM lines of output context
14.4.4. --color
14.5. Regexp selection and interpretation
14.5.1. .*
14.5.2. 2010:(13|14|15|16)
14.5.3. []與{}
14.6. ^M
14.7. egrep
15. sort - sort lines of text files
15.1. 對列排序
16. uniq
17. 行列轉換,表格操作
17.1. column - columnate lists
17.2. paste - merge lines of files

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

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
			
comments powered by Disqus