UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 7th, 2006, 02:05 PM
jennashton jennashton is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 138 jennashton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 29 m 22 sec
Reputation Power: 6
Counting values found in .gz file question

So, just learned the other day to use zgrep 'value' myfile.gz to find a value within the .gz file. Is there a way to count the value rather than printing out every value using zgrep?

Reply With Quote
  #2  
Old August 7th, 2006, 02:15 PM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,728 stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 22 h 41 m 16 sec
Reputation Power: 354
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
I'm not familiar with zgrep but a simple way would be something like:

Code:
gunzip -dc <filename> | grep -c <string_to_search_for>
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Reply With Quote
  #3  
Old August 7th, 2006, 02:54 PM
jennashton jennashton is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 138 jennashton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 29 m 22 sec
Reputation Power: 6
Quote:
Originally Posted by stdunbar
I'm not familiar with zgrep but a simple way would be something like:

Code:
gunzip -dc <filename> | grep -c <string_to_search_for>


Thanks, I was able to use zgrep -c value filename.gz via cygwin. I'll read up more on zgrep.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Counting values found in .gz file question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT