テキストの複数の「チャンク」を持つテキストファイルがあります。これらのチャンクは、複数のラインを有しており、空行で分離されている例えば:PowerShellの複数行の文字列から単一行の文字列への変換
This is an example line This is an example line This is an example line This is another example line This is another example line This is another example line
Iは、例えば、単一のライン形式であるために、これらのチャンクを必要とします
This is an example lineThis is an example lineThis is an example line This is another example lineThis is another example lineThis is another example line
私はこれを完全に調査し、テキストファイル全体を1行にする方法しか見つけていません。私は文字列チャンクの配列を単一行にする方法が必要です。これを達成する方法はありますか?
編集: 私は少し内容を明確にするために例のコンテンツを編集しました。
パーフェクト一つはnegative lookahead assertionと、正規表現の置換を使用することです。どうもありがとう! – AJennings1