Extracting specific lines with Perl

前端 未结 4 810
孤城傲影
孤城傲影 2021-01-20 20:14

I am writing a perl program to extract lines that are in between the two patterns i am matching. for example the below text file has 6 lines. I am matching load balancer and

4条回答
  •  我在风中等你
    2021-01-20 20:27

    If you prefer a command line variation:

    perl -ne 'print if m{\*load balancer\*}..m{\*end\*} and !m{\*load|\*end}' file
    

提交回复
热议问题