Skip to main content

All Questions

0 votes
1 answer
722 views

How to delete a line based on a regex string in Powershell?

I want to validate if the line above a certain line is there, then ok. if else, then delete that line and remove the empty space ? Can this be done in powershell? please help If before all lines ...
coder234's user avatar
0 votes
1 answer
2k views

How to implement regex on a powershell find and replace to quickly change file names in windows 10?

Hi I have a set of files in a folder (windows 10) that are named something like this: asfdjlaksjfdi09908jfakl.part1.rar aabdjkhihsdjkf.part2.rar sdjklufia9798uiownlnsadkfasdFASDFrwe34342.part3.rar ... ...
easy ijoijo's user avatar
0 votes
1 answer
507 views

Regex pattern works in powershell but not in notepad++

I use the following line in powershell, which finds what I am looking for. Select-String -Path *.txt -Pattern '(.*)pov\"(.*)Fred(.*)\"$' but I cannot get the find command in notepad++ to ...
DavidCF's user avatar
1 vote
2 answers
2k views

Converting C# Regex To PowerShell

Our Software department has a program that runs SQL scripts from a certain folder. I now need to replicate this functionality in PowerShell. C#: var commands = Regex.Split(sqlFileText, @"^\s*GO\s*$",...
Deadly-Bagel's user avatar