Bob Showalter am Donnerstag, 30. März 2006 23.32:
> Chas Owens wrote:
> > If we are going to pick nits then it should be
> >
> > grep -c "" fn
>
> Note that grep -c counts matching *lines*. There is no formal
> requirement that these elements appear on separate lines.
Dave,
my first one-liner su
Chas Owens wrote:
If we are going to pick nits then it should be
grep -c "" fn
Note that grep -c counts matching *lines*. There is no formal
requirement that these elements appear on separate lines.
Here's a slightly more complex Perl one-liner that counts *occurences*
perl -lne '$n++ f
Chas Owens am Donnerstag, 30. März 2006 22.35:
> > > cat fn | grep | wc
[...]
> > grep fn | wc
[...]
> If we are going to pick nits then it should be
>
> grep -c "" fn
too much work.
c "" fn
But your alias may be different ;-)
Hans
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
On 3/30/06, Hans Meier (John Doe) <[EMAIL PROTECTED]> wrote:
> Gavin Bowlby am Donnerstag, 30. März 2006 21.45:
> > How about:
> >
> > cat fn | grep | wc
>
> When I posted a "cat | grep" the first (and last) time, several people got a
> well known heart attack :-)
>
> grep fn | wc
>
> > as a non-
Gavin Bowlby am Donnerstag, 30. März 2006 21.45:
> How about:
>
> cat fn | grep | wc
When I posted a "cat | grep" the first (and last) time, several people got a
well known heart attack :-)
grep fn | wc
> as a non-Perl approach to the problem...
[...]
Agreed, but OT here ;-)
Hans
--
To uns
How about:
cat fn | grep | wc
as a non-Perl approach to the problem...
-Original Message-
From: Hans Meier (John Doe) [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 30, 2006 11:38 AM
To: beginners@perl.org
Subject: Re: Counting specific elements in a XML object
Dave Adams am
Dave Adams am Donnerstag, 30. März 2006 21.12:
> If I have a xml file like the following:
>
>
>
> John Doe
> 43
> M
> Recieving
>
>
> Bob Gordon
> 50
> M
> Shipping
>
>
>
> Is there some perl module out there that can help me get