免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 749 | 回复: 0
打印 上一主题 下一主题

winavr util妙用 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-28 10:13 |只看该作者 |倒序浏览
WinAVR-20080610.exe 不仅是一个WinAVR的编译器,同时支持许多Linux命令的Win32版!

cat.exe
ls.exe
grep.exe
gawk.exe
etc..

经测试,很不错! 下面给出一些例子

gawk exsample:

输入文件内容如下:
input.txt

Timestep at 0
[Exp.Dist] t1 8
Timestep at 1
[Exp.Dist] t1 2
Timestep at 2
[Exp.Dist] t1 7
Timestep at 3
Delayed transition t1 fired at time 4
[Exp.Dist] t1 0
Timestep at 4
Delayed transition t1 fired at time 5
[Exp.Dist] t1 10
Timestep at 5
[Exp.Dist] t1 9
Timestep at 6
[Exp.Dist] t1 1
Timestep at 7
Delayed transition t1 fired at time 8
[Exp.Dist] t1 2
Timestep at 8
Delayed transition t1 fired at time 9
[Exp.Dist] t1 0
Timestep at 9
Delayed transition t1 fired at time 10
Delayed transition t1 fired at time 10
Delayed transition t1 fired at time 10
[Exp.Dist] t1 19
Timestep at 10
[Exp.Dist] t1 9
Timestep at 11
[Exp.Dist] t1 18
Timestep at 12
[Exp.Dist] t1 8
Timestep at 13
[Exp.Dist] t1 26
Timestep at 14
Delayed transition t1 fired at time 15
Delayed transition t1 fired at time 15

要求把以[Exp.Dist]开头的行过滤数来,同时打印如下:  t1 8

所用命令如下:

gawk '/^\[Exp.Dist\]/ {print $2 " " $3}' input.txt > output.txt



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/31891/showart_1269753.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP