0
텍스트를 빈 줄로 구분하여 파일에 넣을 수있었습니다. 특정 문자열이있는 단락 만 유지하려고합니다. Sed의 질문이 작동하지 않는 해결책을 언급하지만이 작동하지 않는 이유sed stream editor unix linux 명령 : 특정 텍스트 문자열로 단락을 유지하는 방법
http://www.catonmat.net/blog/sed-one-liners-explained-part-two/
58. Print a paragraph that contains “AAA”. (Paragraphs are separated by blank lines).
sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;'
http://www.linuxhowtos.org/System/sedoneliner.htm?ref=news.rdf
# print paragraph if it contains AAA (blank lines separate paragraphs)
# HHsed v1.5 must insert a 'G;' after 'x;' in the next 3 scripts below
sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;'
당신이 말해 주시겠습니까 (아래 예 참조). 또한 유닉스 도구가 있거나 다른 방법으로 해결책을 알고 있다면 알려주십시오.
웁, 즉 읽기가 어렵다. 질문을 다시 포맷 할 수 있습니까? – perimosocordiae
그냥 Lorem ipsum을 붙잡고 'AAA'를 여러 단어로 바꾸어 테스트했습니다. 광고 된대로 작동하는 것 같습니다 :'sed -e '/./{H;$!d;}'-e 'x;/Pellentesque /! d; ' lipsum.txt' – opello
"일하지 않는 것"보다 훨씬 구체적 일 수 있습니까? –