int f0/0.12
en 12
no sh
int f0/0.13
en 13
no sh
int f0/0.14
en 14
no sh
上面的是原始数据
想把int f0/0.*换成int f0/0.*\ndu fu ///*代表12到200之间的数字
怎样实现
谢谢
gedit如何实现如下需求
-
- 帖子: 141
- 注册时间: 2006-05-03 9:10
- jioyo源
- 帖子: 3476
- 注册时间: 2008-10-08 13:48
Re: gedit如何实现如下需求
awk '{gsub("int f0/0.*","int f0/0.*\\ndu fu ///*",$0); print $0 >FILENAME}' yourfilename
--------------------------------------
论坛精华贴全集:http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=199845
book:http://forum.ubuntu.org.cn/viewtopic.php?f=21&t=198286
论坛精华贴全集:http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=199845
book:http://forum.ubuntu.org.cn/viewtopic.php?f=21&t=198286
-
- 帖子: 141
- 注册时间: 2006-05-03 9:10
Re: gedit如何实现如下需求
谢谢jioyo源 写了:awk '{gsub("int f0/0.*","int f0/0.*\\ndu fu ///*",$0); print $0 >FILENAME}' yourfilename
- hellojinjie
- 帖子: 1150
- 注册时间: 2007-09-14 21:03
- 来自: 浙江
- jioyo源
- 帖子: 3476
- 注册时间: 2008-10-08 13:48
Re: gedit如何实现如下需求
hellojinjie 写了:其实你直接说用awk 或sed就行了

--------------------------------------
论坛精华贴全集:http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=199845
book:http://forum.ubuntu.org.cn/viewtopic.php?f=21&t=198286
论坛精华贴全集:http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=199845
book:http://forum.ubuntu.org.cn/viewtopic.php?f=21&t=198286