Hello
I am trying to split a file
Everytime it finds the Word SPLIT
The below did not work
$Path = "C:\Users\PLW\Desktop\a\"
$InputFile = (Join-Path $Path "File.txt")
$Reader = New-Object System.IO.StreamReader($InputFile)
While (($Line = $Reader.ReadLine()) -ne $null) {
If ($Line -match "SPLIT") {
$OutputFile = $matches[1] + ".txt"
}
Add-Content (Join-Path $Path $OutputFile) $Line
}
http://superuser.com/questions/466363/how-to-split-a-text-file-into-multiple-text-files
I don't know what the problem is :(
thank you for your help