This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Hi
I have a file with the following attendance list, I have extract the names who are present(with numeric 1) $_ -like '*: 1*' into a variable $ListA.
Kevin: 1
Johnny: 1
Sean:
Chang:
Mike: 1
Nelson:
Which give me
How do i remove all the : and 1 when output it to txt in one sentence like
Kevin, Johnny, mike
'Johnny: 1' -replace '\:\s+1'
\_(ツ)_/
Thanks again,
i got it.
Time to learn PowerShell before it is too late:
Get-Content c:\$CA.txt | %{$_ -replace '\:\s+1' } | Out-File C:\class501\CAnew.txt