重新连接由连字符和双换行符分隔的单词

重新连接由连字符和双换行符分隔的单词

我已经使用 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”。但在连字符后面有两个换行符的情况下,我无法用perl -p -e 's/-\n\n//or替换单词。tr -d '\-\n\n'有任何想法吗?

答案1

cuonglm 提供了在评论中回答这似乎有效:

perl -0pe 's/-\n\n//g'

相关内容