Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $file = New-Object System.IO.StreamReader -Arg "<path to your file>"
- $count = 0
- $lines = @()
- while ($line = $file.ReadLine()) {
- $lines += $line
- $count++
- if ($count % 1000 -eq 0) {
- $lines | Out-File ("splitfile_" + (Get-Date).ToFileTimeUTC() + ".csv")
- $lines = @()
- $count = 0
- }
- }
- $file.close()
Add Comment
Please, Sign In to add comment