Hi developer,
I have a written a script but i have no idea how to the foreach output loop to csv file.
Script is below:
$regex = "([A-Za-z])\w+|\d+" $matchInfo = @((Get-Content \test.txt) |Select-String -Pattern $regex -AllMatches)) $output = foreach($minfo in $matchInfo) { foreach($match in @($minfo.Matches | Foreach {$_.Groups[0].value})) { Write-host -NoNewline "$match," } Write-Host "" } $output | ???????
I tried this:
$output | Out-File -FilePath Test.csv -Encoding OEM
So i opened the Test.csv and no data. it is empty.
Any Idea?
Thanks
- Edited by IamGuy84 21 hours 38 minutes ago