随笔 - 53, 文章 - 0, 评论 - 3, 引用 - 0
数据加载中……

How to substitute text in the file.

9/26/2008 8:57AM
Today I want to research the different ways to substitute text in the file. For records, I written them down.

1. use Ultra Edit, it is super easy for a Windows user if you have Ultra Edit installed.
use Ctrl + R to get Replacement Wizard and follow you intuition.

2. use VI in Unix.
:s/xx/yy/
will replace xx with yy.

3. use filter, such as sed, and awk in Unix.
sed -e 's/xx/yy/g' file.in > file.out
replace xx with yy in all the lines. It seem sed will not change the original input file, so I redirect the out put to file.out


posted on 2008-09-26 10:24 InPractice 阅读(78) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: