appears 4 or more time


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers appears 4 or more time
# 1  
Old 10-19-2007
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.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Errexit APPEARS set in subshells

Hi there, Everyone knows that errexit is NOT inherited by subshells. But does anyone know why errexit still appears as set with set +o? The following example highlights the fact that errexit appears set in a subshell (set +o) even though it's actually unset (it does NOT exit with false). $... (0 Replies)
Discussion started by: chebarbudo
0 Replies

2. Shell Programming and Scripting

I need to appears as different ip address when I send a form

Hi my problem is that I need to send a form to a web address using curl, from a unix shell, the web address on the receiving end will only accept incoming data from a specific ip address, and port, on another machine on our intranet, and I can not run curl on that machine. Is there any way I... (5 Replies)
Discussion started by: Paul Walker
5 Replies

3. AIX

oracle process appears to die

periodically my oracle 11.2.0.1 listener process 'tnslsnr' seems to crash and disappear ( I am using an AIX 6.1 unix platform ). When this happens I am able to restart my listener ok. However when this happens there is is no stop recorded in my listener log (as there normally would be - hence why I... (1 Reply)
Discussion started by: jimthompson
1 Replies

4. UNIX for Dummies Questions & Answers

print records where an ID appears more than once

Hi everyone! I have something like the following records in a file: ID: 1 Name: A Age: 23 ID: 2 Name: B ID: 1 Activity: Climbing ID: 3 Name: C ID: 3 Activity: Skating I want to capture the records where the field Age exists AND the records that have the same ID as the one... (4 Replies)
Discussion started by: Atrisa
4 Replies

5. UNIX for Dummies Questions & Answers

how to find a word in a file that appears next to a given keyword

Hi Experts, I have a file which contains some text. i need to print the word next to a given keyword. Please help. Ex: test.txt ===================== NEXT HOST ===================== AEADBAS001 access-list 1 permit xxxxxxxxxxxxxx ip access-list extended BLA_Outgoing_Filter... (6 Replies)
Discussion started by: mwrg
6 Replies

6. AIX

A fix appears to be installed, but does not show under instfix

I am running HACMP 5.4 under AIX 5.3. I need to upgrade my TSM to 5.5. 5.5 requires a fix install (IY89869) for the HACMP. I looked under both instfix and smitty to see inf the fix was installed, it was not. I downloaded the fix, and did a preview install. I was informed that the "update... (2 Replies)
Discussion started by: mhenryj
2 Replies

7. Shell Programming and Scripting

Take action if a particular file appears in a directory

This is my task - pls help Write a script that will run every 5 min and check if a particular file has appeared in a particular directory. Once it appears then rename the file and move it a bkp directory and run another script. (3 Replies)
Discussion started by: mrudula009
3 Replies

8. Shell Programming and Scripting

delimiter appears in field

The typical line of the input file is as follows, 123|abcde|"xyz|mn"|ghelosa|3455hello| The delimiter is |. I need to change it to another delimiter, say ~. For the above line, the output should be: 123~abcde~xyz|mn~ghelosa~3455hello~ The challenge is when | appears in a field, it... (2 Replies)
Discussion started by: derekxu
2 Replies

9. UNIX for Dummies Questions & Answers

Sort - only one field appears in output?

I'm running against a file with 1008 records like this, all beginning '4760 Slave': 4760 Slave,7,3607 ,GL ,200605,11320024 , ,GBP ,X00033 ,AI80190 ... (1 Reply)
Discussion started by: miwinter
1 Replies
Login or Register to Ask a Question