powershell - select -first 1 on a large file -


i trying run following command on large text file. however, it's slow

((cat largefile.txt | select -first 1).split(",")).count() 

is alternative fast way in powershell? seems command scan whole file no matter what.

to first x number of lines in text file, use รข€“totalcount parameter:

((get-content largefile.txt -totalcount 1).split(",")).count 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -