Skip to content

Instantly share code, notes, and snippets.

@josephbales
Created March 29, 2015 15:55
Show Gist options
  • Save josephbales/fed14c99bcc101b06c5e to your computer and use it in GitHub Desktop.
Save josephbales/fed14c99bcc101b06c5e to your computer and use it in GitHub Desktop.
Takes a file, splits it into chunks of 8 lines, orders the chunks of 8 lines into a tab delimited string, writes to file
$inputfile = "Week"
$outputfile = "plan.txt"
Out-File $outputfile
$input = Get-Content $inputfile
$i = 0
$l = $input.Length
while ($i -lt $l)
{
$chunk = (Get-Content $inputfile)[$i..($i+7)]
Add-Content $outputfile ($chunk -join "`t")
$i+=8
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment