Re: Count lines in file..fast

From: Ross Alexander (ralexan9_at_telusplanet.net)
Date: 06/19/03

  • Next message: Dave.Zarnoch_at_SUNGARD.COM: "send multiple email attachments"
    Date:         Thu, 19 Jun 2003 08:22:09 -0600
    To: aix-l@Princeton.EDU
    
    

    On Thu, 19 Jun 2003, Frank Chiavoni wrote:

    > -----Original Message-----
    >
    > I need a fast method of counting lines in a file that contain a
    > specific
    > string.
    >
    > I am currently using grep mystring myfile | wc -l
    >
    > but this is slow on large files.
    >
    > Anyone got a faster method?
    >
    > AP
    >
    > ---------------------
    >
    > sed -n '$=' myfile

    grep -c

    regards,
    Ross

    --
    Ross Alexander
    (780) 975 3505 cell / (780) 433 6725 home
    ralexan9@telusplanet.net
    

  • Next message: Dave.Zarnoch_at_SUNGARD.COM: "send multiple email attachments"

    Relevant Pages

    • Re: Count lines in file..fast
      ... I need a fast method of counting lines in a file that contain a ... string. ... I am currently using grep mystring myfile | wc -l ...
      (AIX-L)
    • Count lines in file..fast
      ... I need a fast method of counting lines in a file that contain a specific ... string. ... I am currently using grep mystring myfile | wc -l ...
      (AIX-L)