Chinaunix首页 | 论坛 | 博客
  • 博客访问: 631724
  • 博文数量: 184
  • 博客积分: 10057
  • 博客等级: 上将
  • 技术积分: 2505
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-31 16:34
文章分类

全部博文(184)

文章存档

2010年(5)

2009年(104)

2008年(75)

我的朋友

分类: LINUX

2009-04-20 21:56:33

'colrm' is a column removal filter.
If only one parameter is specified, the characters of each line will be removed starting from that specified column number, if called with two parameters (range of character position to remove) the columns/characters from character position x to character position y will be removed.

Some examples:

# Remove characters from 2nd character position till end
$ echo "abcdefghij" | colrm 2
a

# Remove characters from 2nd to 5th column position
$ echo "abcdefghij" | colrm 2 5
afghij

#The following command deletes the characters in column 4-8 from the file file.txt
$ colrm 4 8 < file.txt

阅读(619) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~