- 论坛徽章:
- 0
|
好久没来了,之前学的shell技巧也忘记的十之有八了。
请教一个问题
有一个文本a.txt
内容如下
3.230: [full gc (system)3.230: [cms : ok->3729k(1310720k),0.0657070 secs】75511k->3729k(1939904k),[cms perm : 13040k->13029k(307200k)],0.0657790 secs] [times: user=0.07 sys=0.01,real=0.07 secs]
12.745:[gc 8.675: [parnew: 471936->21331k(629184k),0.035690 secs] [times: user=0.07 sys=0.01,real=0.07 secs]
12.745:[gc 8.675: [parnew: 471936->21331k(629184k),0.035690 secs] [times: user=0.07 sys=0.01,real=0.07 secs]
12.745:[gc 8.675: [parnew: 471936->21331k(629184k),0.035690 secs] [times: user=0.07 sys=0.01,real=0.07 secs]
........
3.230: [full gc (system)3.230: [cms : ok->3729k(1310720k),0.0657070 secs】75511k->3729k(1939904k),[cms perm : 13040k->13029k(307200k)],0.0657790 secs] [times: user=0.07 sys=0.01,real=0.07 secs]
12.745:[gc 8.675: [parnew: 471936->21331k(629184k),0.035690 secs] [times: user=0.07 sys=0.01,real=0.07 secs]
12.745:[gc 8.675: [parnew: 471936->21331k(629184k),0.035690 secs] [times: user=0.07 sys=0.01,real=0.07 secs]
...........
3.230: [full gc (system)3.230: [cms : ok->3729k(1310720k),0.0657070 secs】75511k->3729k(1939904k),[cms perm : 13040k->13029k(307200k)],0.0657790 secs] [times: user=0.07 sys=0.01,real=0.07 secs]
3.230: [full gc (system)3.230: [cms : ok->3729k(1310720k),0.0657070 secs】75511k->3729k(1939904k),[cms perm : 13040k->13029k(307200k)],0.0657790 secs] [times: user=0.07 sys=0.01,real=0.07 secs]
如何能将上面文本按[full gc为关键字搜索 找到这行以后. 把两个[full gc之间的内容的换行符删除.
也就是以[full gc为关键合并行.一行保证只有一个[full gc
多谢了 |
|