Guest User

Untitled

a guest
Jul 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. $file = New-Object System.IO.StreamReader -Arg "<path to your file>"
  2. $count = 0
  3. $lines = @()
  4. while ($line = $file.ReadLine()) {
  5. $lines += $line
  6. $count++
  7. if ($count % 1000 -eq 0) {
  8. $lines | Out-File ("splitfile_" + (Get-Date).ToFileTimeUTC() + ".csv")
  9. $lines = @()
  10. $count = 0
  11. }
  12. }
  13. $file.close()
Add Comment
Please, Sign In to add comment