Replace string  in a list which start with Security and end ) – installed aplication

I have  exported a list of installed application from a lot of computers. Problem is, that i would like to remove all Windows updates, etc that are in a list..

List is build like :

Server1, Security9), Adobe,7zip,app1,Secur..7)

Server2, Security2), Adobe,7zip,app1,Secur..3),Office

Server2, Adobe,7zip,app1,Secur..3),Office,bdm

Basically, i can not replace  Security..)

If i try $str = $str -replace 'Security[^)]',',', i get  output

Server1, 9), Adobe,7zip,app1,..7)

I would like to get output similar like Server1, ,Adobe,7zip,app1)

July 21st, 2015 7:22am

$s='Server1, Security9), Adobe,7zip,app1,Secur..7)' -replace 'Security\S\d\)',''
$s -replace 'Secur\.+\d',''

Free Windows Admin Tool Kit Click here and download it now
July 21st, 2015 7:49am

'Server1, Security9), Adobe,7zip,app1,Secur..7)' -match'Security\S\d\)'  --> True

'Security Update for Windows Server 2003 (KB2229593), Security Update for Windows Server 2003 (KB2347290), Security Update for Windows Server 2003 (KB2378111), Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148, Microsoft Silverlight 5.1' -match' Security\S\d\)'  ---> False

July 21st, 2015 9:39am

I don't think you really have text.  You have dumped the security updates list incorrectly and now the formatting is munged.

It is not likely that you can fix it.

Where did you get this file?

Free Windows Admin Tool Kit Click here and download it now
July 21st, 2015 10:15am

Yes it is a dump.

Each line consist of what is installed on server. Every entry is delimited with , .

Basically i have dump of circa 250 servers from windows server 2000, to windows server 2012 R2.

I would like to remove everything that have anything to do with windows update.  I would like to clean up a list, and Im doing wrong something basic.

July 21st, 2015 1:21pm

What is it that you are trying to get by extracting this file?  What created this file?

We can get all updates by name in may very easy ways.

Free Windows Admin Tool Kit Click here and download it now
July 21st, 2015 6:01pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics