Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] GREP basics



On Fri, 2003-01-31 at 02:07, Charles Muller wrote:
> The immediate and accurate solutions to my GREP query are deeply
> appreciated. Both the GREP and PERL methods worked fine (but PERL was about 5
> times faster) as you can see below:
> 
> [chuck@example.com ddbxml]$ grep "<hdwd>" * | wc -l
>   23765
> 
> [chuck@example.com ddbxml]$ perl -ne '$m += split /<hdwd>/; --$m; END {print "$m\n"}' *
> 23765
> 
> 
>        The documents in question are structured dictionary XML documents where
> there can only be one <hdwd> on each line, so that was not a problem. Now
> I'll do a little research to try to learn a bit about how both of these work.

Maybe explaining this *first* would have save time to everybody here...
A simple grep does the job, then.
And please use "grep -l yourstuff *" instead of piping, if you wish to
compare.... This is my last help for you...

I *hate* spending my time for lazy people...

br.


-- 
GPG Key: 653514E5 (http://www.raoult.com/gpg)
--
If it happens once, it's a bug.
If it happens twice, it's a feature.
If it happens more than twice, it's a design philosophy.

Attachment: signature.asc
Description: This is a digitally signed message part


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links