
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.
「プレミス」と「population」という言葉を組み合わせたいです。パターンは "-\n\n" でなければなりません。ただし、ハイフンの後に2つの改行がある場合は、orで単語を置き換えることはできませんperl -p -e 's/-\n\n//
。tr -d '\-\n\n'
どんなアイデアがありますか?
答え1
cuonglmが提供するコメントで答えてくださいこれはうまくいくようです:
perl -0pe 's/-\n\n//g'