How to use sed/grep to extract text between two words?

后端 未结 12 2520
春和景丽
春和景丽 2020-11-22 05:25

I am trying to output a string that contains everything between two words of a string:

input:

\"Here is a String\"

output:

12条回答
  •  自闭症患者
    2020-11-22 06:10

    If you have a long file with many multi-line ocurrences, it is useful to first print number lines:

    cat -n file | sed -n '/Here/,/String/p'
    

提交回复
热议问题