Remove text pattern from the text file using PowerShell

Viewed 69

I have 1000+ files, It has unnecessary code added, it causes any issues while building the code in VS solution.

Need a solution to replace/delete below string from 1000+ files

with

(

)

1 Answers

Don't know about Powershell but this can be easily done in Notepad++

In Find in files option use following entries :

Find what : with\r\n\r\n(\r\n\r\n)\r\n
Replace with : <leave it blank>
Filters : *.cs <or whatever is the extension of your files>
Directory : <path where files are present>

replace text in all files

Related