免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
1234
最近访问板块 发新帖
楼主: 锕鸿
打印 上一主题 下一主题

帮忙看看awk语句哪里错了?【已解决】 [复制链接]

论坛徽章:
0
31 [报告]
发表于 2009-06-04 14:18 |只看该作者
gawk --re-interval '/[a-zA-Z]{4}/ {if ($1!~/[a-zA-Z]{5,}/) print $1}' abc.data

[root@magw ~]# gawk -W version
GNU Awk 3.1.3
Copyright (C) 1989, 1991-2003 Free Software Foundation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
[root@magw ~]#

论坛徽章:
0
32 [报告]
发表于 2009-06-05 08:19 |只看该作者
awk '{if(length($1)==4 && $1~/[a-zA-Z]+/)print $1}'  ufile

论坛徽章:
0
33 [报告]
发表于 2009-06-08 12:17 |只看该作者
都是强拧呀!

论坛徽章:
0
34 [报告]
发表于 2009-06-08 13:20 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
35 [报告]
发表于 2009-06-10 20:28 |只看该作者

回复 #34 houlangqianlan 的帖子

你看看这样行吗?

awk '$1 ~/^[a-zA-Z]{4}$/{print $1}' abc.data
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP