PowerShell: how to count number of rows in csv file?
Get-Content and Measure-Object are fine for small files, but both are super inefficient with memory. I had real problems with large files. When counting rows in a 1GB file using either method, Powershell gobbled up all available memory on the server (8GB), then started paging to disk. I left it over an hour, but it … Read more