Replace Words with a linebreak
问题 This is my Textfile (temp.txt): (test1 AND id=42343) AND NOT (test2 AND id=12234) AND NOT (test3 AND id=12342) AND NOT (test4 AND id=13342) I have to replace all ")AND NOT(" so that the file after formatation look like this: test1 AND id=42343 test2 AND id=12234 test3 AND id=12342 test4 AND id=13342 I tried this Script/Command: (Get-Content C:\temp.txt) |ForEach-Object{$_ -replace "[) AND NOT (]","`n`r"}|Set-Content C:\temp.txt But now the textfile looks terrible: es 1 i =42343 es 2 i =12234