How to find the number of occurrences of a string in file using windows command line?

前端 未结 9 1429
生来不讨喜
生来不讨喜 2021-01-01 23:35

I have a huge files with e-mail addresses and I would like to count how many of them are in this file. How can I do that using Windows\' command line ?

I have tried

9条回答
  •  温柔的废话
    2021-01-02 00:11

    I would install the unix tools on your system (handy in any case :-), then it's really simple - look e.g. here:

    Count the number of occurrences of a string using sed?

    (Using awk:

    awk '$1 ~ /title/ {++c} END {print c}' FS=: myFile.txt
    

    ).

    You can get the Windows unix tools here:

    http://unxutils.sourceforge.net/

提交回复
热议问题