截取一段字符
发布日期:2021-09-16 04:38:55 浏览次数:47 分类:技术文章

本文共 368 字,大约阅读时间需要 1 分钟。

今天在处理mysqlbinlog的时候insert,和update 语句比较长换行比较多,有点类似于

要截取整段文字,如果截取

<phase a>
this is a test
hellow world     
</phase>

用下面的shell就可以处理整段文字,获取<phase a> 开头,</phase>结尾的一段

[root@rac1 ~]# sed -ne '/\<phase a\>/,/^<\/phase>/p' 1.txt

<phase a>
this is a test
hellow world     
</phase>

[root@rac1 ~]# sed -ne '/<phase a>/,/^<\/phase>/p' 1.txt

<phase a>
this is a test
hellow world     
</phase>

转载地址:https://blog.csdn.net/wll_1017/article/details/55193181 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:58到家数据库30条军规解读
下一篇:修改lower_case_table_names产生的问题

发表评论

最新留言

路过按个爪印,很不错,赞一个!
[***.219.124.196]2024年04月13日 13时10分13秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章