Created
August 5, 2016 11:08
-
-
Save Stuart-Moore/bd401f7860a50840466d882ab18022b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$output = @() | |
$plineblank = $false | |
$tline = '' | |
$reader = [System.IO.File]::OpenText("C:\full\path\to\testfile.txt ") | |
while($null -ne ($line = $reader.ReadLine())) { | |
if ($line -eq '' -and $pline -ne '' ){ | |
$output += $tline | |
$tline = $null | |
} else { | |
$tline = $tline+"`n"+$line | |
} | |
$pline = $line | |
} | |
$output += $tline | |
$reader.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment