Last active
April 5, 2017 20:19
-
-
Save statgeek/de01cb34a61e53f2915d to your computer and use it in GitHub Desktop.
Windows Powershell - Extract top N lines from file to a new file
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
*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