I am trying to run the following command on a very large text file. However, it's very slow
((cat largefile.txt | select -first 1).split(",")).count()
Is an alternative fast way in powershell? It seems the command will scan the whole file no matter what.