I have a csv export where i get some info. Of the 4 lines below line 1 and 2 are fine.
lines 3 and 4 need to have the "2 x " stripped out and also with line 4 I only want the name henrietta anything after the comma (including the comma) to be omitted.
Id like to use a wildcard in place of the number
Linda
bobbyjoe
2 x ash
3 x Henrietta,suzyann,waynebruce,parkerpeter
Currently im using as below. which only, I havent solves part of the problem I havent found an answer online that I understand.
$filepath = "c:\mycsv.csv"
$bad2 = "2 x "
$good2 = `b
$bad2 = "3 x "
$good2 = `b
get-content $filepath | % { $_ -replace $bad2 , $good2 } | % { $_ -replace $bad3 , $good3 } | set-content $saveloc\tidied-$date.csv