[CentOS] Inquiry:How to compare two files but not in line-by-line basis?

hadi motamedi motamedi24 at gmail.com
Sat Dec 5 08:50:35 UTC 2009


On Thu, Dec 3, 2009 at 12:42 PM, mark <m.roth at 5-cent.us> wrote:

> John Doe wrote:
> > From: hadi motamedi <motamedi24 at gmail.com>
> >> Can you please do me favor and let me know if I can go further and try
> for
> >> advanced search like finding how many rows inside a file have data that
> >> does not start with a zero after the third comma ?
> >
> > Something like: awk -F, ' { print $4 } ' | grep -v "^0" | wc -l Use one
> > command at a time to see how they work with each other (you might have to
> > modify the grep a bit)...
>
> *sigh*
>
> Drive me crazy, why use multiple commands?
>
> awk -F 'BEGIN { FS = ","; }{if ( $3 !~ /^0 ) { count++; }} END { print
> count }'
> filename
>
>        mark "why, yes, since you ask, I *have* written 100 and
>                200 line awk scripts"
> --
> Though I don't think (object-oriented programming) has much to offer good
> programmers, except in certain specialized domains, it is irresistible to
> large organizations. Object-oriented programming offers a sustainable way
> to write spaghetti code.  - Paul Graham
>  _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>


Sorry . I tried for your proposed procedure , as the followings :
#awk -F 'BEGIN { FS = ","; }{if ( $3 !~ /^0 ) { count++; }} END { print
count }' HLRSubscriber-20091111173349.csv
But my CentOS server didn't return to the prompt . Can you please let me
know why it is in an end-less iterated loop ?
Thank you in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.centos.org/pipermail/centos/attachments/20091205/d4333cda/attachment.html 


More information about the CentOS mailing list