jeudi 16 avril 2015

Removing text in a string between two characters using Powershell

I have a powershell script that runs and collects information and puts it in a .csv file. A sample of the information looks like what is listed below, with each line starting with a unique server name followed by a random unique identifier in contained a pair of ( ).



"GDR01W01SQ004 (e785754f-eeb1)","1","4","63","NY-TER-PLN-P-5N"
"GDR01L02D001 (4b889a4d-d281)","4","12","129","CO-FDP-STE-NP-5N"


I have a second powershell script that runs and takes this .csv file and its information and formats it into a report with a header and proper spacing.


Can someone please assist me with removing the text in between the ( ) as well as the ( )?


I would like the entries for each line to look like the following:



"GDR01W01SQ004","1","4","63","NY-TER-PLN-P-5N"


Thank you very much in advance!


Aucun commentaire:

Enregistrer un commentaire