Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get-Content $tempDir$todaysLog | Where-Object { $_ -match "" } |
- ForEach-Object -Process {
- $fields = [regex]::split($_,'@|s+')
- Add-Content -Path $importSource2$todaysLog -value ($($fields[0]) + "`t" + $($fields[1]) + "`t" + $($fields[2]) + " " + $($fields[3])+ "`t" + "<*sender*@"+($($fields[5])) + "`t" + "<*recipient*@"+($($fields[7])))
- }
- cat $tempDir$todaysLog |
- %{ [regex]::Replace($_, "[A-Z0-9._%+-]+(@[A-Z0-9.-]+.[A-Z]{2,4}s<[')[A-Z0-9._%+-]+(@[A-Z0-9.-]+.[A-Z]{2,4}']>)", '*sender*$1*recipients*$2', "IgnoreCase") } > $importSource2$todaysLog
- Measure-Command {
- Get-Content $tempDir$todaysLog | Where-Object { $_ -match "" } |
- ForEach-Object -Process {
- $fields = [regex]::split($_,'@|s+')
- Add-Content -Path $importSource2$todaysLog -value ($($fields[0]) + "`t" + $($fields[1]) + "`t" + $($fields[2]) + " " + $($fields[3])+ "`t" + "<*sender*@"+($($fields[5])) + "`t" + "<*recipient*@"+($($fields[7])))
- }
- }
- Measure-Command {
- Get-Content $tempDir$todaysLog | Where-Object { $_ -match "" } |
- ForEach-Object -Process {
- $s2 = $_ -replace "t[^@t']+@", "`t*sender*@"
- $s3 = $s2 -replace "<['.+@", "<['*recipient*@"
- Add-Content -Path $importSource2$todaysLog -value $s3
- }
- }
- Measure-Command {
- cat $tempDir$todaysLog |
- %{ [regex]::Replace($_, "[A-Z0-9._%+-]+(@[A-Z0-9.-]+.[A-Z]{2,4}s<[')[A-Z0-9._%+-]+(@[A-Z0-9.-]+.[A-Z]{2,4}']>)", '*sender*$1*recipients*$2', "IgnoreCase") } > $importSource2$todaysLog
- }
- $s1 = "10.197.71.28 SG 02012009 00:00:00 sender@kpmg.com <['recip@kpmg.com.sg']>"
- $s2 = $s1 -replace "t[^@t']+@", "`t*sender*@"
- $s3 = $s2 -replace "<['.+@", "<['*recipient*@"
- write-host $s3
Add Comment
Please, Sign In to add comment