Skip to content

Instantly share code, notes, and snippets.

@statgeek
Last active April 5, 2017 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statgeek/de01cb34a61e53f2915d to your computer and use it in GitHub Desktop.
Save statgeek/de01cb34a61e53f2915d to your computer and use it in GitHub Desktop.
Windows Powershell - Extract top N lines from file to a new file
*Extract n lines to a new file;
gc -path file_name.csv - head N > output.txt
*Get the number of lines in a text file;
Get-Content "Path to file"| Measure-Object -Line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment