
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] GREP basics
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.
Thanks!!
Chuck
[chuck@example.com ddbxml]$
---------------------------
Charles Muller <acmuller@example.com>
Faculty of Humanities, Toyo Gakuen University
Digital Dictionary of Buddhism and CJKV-English Dictionary [http://www.acmuller.net]
H-Buddhism List Editor [http://www2.h-net.msu.edu/~buddhism/]
Mobile Phone: 090-9310-1787
Home |
Main Index |
Thread Index