![하이픈과 이중 줄바꿈으로 구분된 단어를 다시 연결하세요.](https://linux55.com/image/90041/%ED%95%98%EC%9D%B4%ED%94%88%EA%B3%BC%20%EC%9D%B4%EC%A4%91%20%EC%A4%84%EB%B0%94%EA%BF%88%EC%9C%BC%EB%A1%9C%20%EA%B5%AC%EB%B6%84%EB%90%9C%20%EB%8B%A8%EC%96%B4%EB%A5%BC%20%EB%8B%A4%EC%8B%9C%20%EC%97%B0%EA%B2%B0%ED%95%98%EC%84%B8%EC%9A%94..png)
Calibre를 사용하여 일부 PDF 파일을 텍스트로 변환했습니다. 텍스트 예는 다음과 같습니다.
The booming population, coupled with a development strategy pre-
mised on high levels of investment, meant that an increasingly large pop-
ulation would be condemned indefinitely to living standards barely above
subsistence level.
"premised"와 "population"이라는 단어를 결합하고 싶습니다. 패턴은 "-\n\n"이어야 합니다. 하지만 하이픈 뒤에 줄바꿈이 두 개 있는 경우에는 or 로 단어를 바꿀 수 없습니다 perl -p -e 's/-\n\n//
. tr -d '\-\n\n'
어떤 아이디어가 있나요?
답변1
cuonglm이 제공하는댓글로 답변해주세요이것은 작동하는 것 같습니다:
perl -0pe 's/-\n\n//g'