The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
grep'ing a file until a certain message appears pallak7 Shell Programming and Scripting 2 05-19-2008 07:11 AM
scp error code after successful transfer - $? appears incorrect badtea Shell Programming and Scripting 5 06-21-2007 07:27 PM
Sort - only one field appears in output? miwinter UNIX for Dummies Questions & Answers 1 07-24-2006 07:47 AM
Power M'ment OW Utilities appears selected when deselected etobgra UNIX for Advanced & Expert Users 0 04-20-2005 07:14 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-19-2007
Registered User
 

Join Date: Sep 2005
Posts: 15
appears 4 or more time

I have a file like this:

111 AA 100.00
111 AA 200.00
TOTALS 2 300.00
111 285.00
111 336.00
222 AA 250.00
222 AA 150.00
TOTALS 2 400.00
333 AA 500.00
333 AA 800.00
TOTALS 2 1300.00
333 111.00
333 222.00
333 957.00
333 466.00

I want to print out the lines when only the conditions exists that $1 appears in the file at least 4 times.

In this file, I would want to print this:

111 AA 100.00
111 AA 200.00
TOTALS 2 300.00
111
111
333 AA 500.00
333 AA 800.00
TOTALS 2 1300.00
333
333
333
333

I have searched all over for a similar example with no luck. I have played with some code, but I am not close. Any help would be appreciated.
Reply With Quote
Google UNIX.COM
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:25 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0