Re: Getting line count of a text file
| From: | mike | Date: | Wed, 12 Sep 2007 20:19:17 +0000 |
| Subject: | Re: Getting line count of a text file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-262051@lists.php.net to get a copy of this message | ||
personally i try to use as little shell commands as possible,
especially stacked on top of each other in exec().
i'd just use explode, str_split, substr/strpos, etc. after i got it back.
On 9/12/07, Wolf <lonewolf@nc.rr.com> wrote:
> Novel approach... But mine's less typing. :)
>
> never thought of using awk for it though. Good one! :)
>
> ---- bruce <bedouglas@earthlink.net> wrote:
> > hey...
> >
> > if you're going to do the system approach, go ahead and use awk/cut...
> >
> > wc -l foo.txt | awk -F' ' '{print $1}'
> >