sed 编辑器

第一次使用,用到了2个命令,处理文本很方便
在每行的下边添加\hline(即自动在每行后添加一行新内容)
sed -i '1~1s/$/\n\\hline/' filename
将偶数行上移到奇数行的末尾,并保存到另一个文件中
sed 'N;s/\s*\n\s*/ /' filename>filename_new

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s