02-05-2010
yes the grep will count how many times similar data repeated but I want if its repeated 3 times then count 5 and then atfer 5 mins by using crontab I will re-access the file and check if it has repeatative data occur or not till it reach counting 40.
example
time 12:00 the file (main) has a data as follow:
BBB111
BBB111
BBB111
TNG877
NNT555
SDF990
SDF990
SDF990
The script should count 5 for BBB111 and store it and count 5 for SDF990 and store it
time 12:05 the file main has a data as follow:
BBB111
BBB111
BBB111
TNG877
NNT555
The script will add another 5 for BBB111 which will 10 adn it will reset the counter for SDF990 to zero.
if BBB111 continue appear into file till count reach 40 then do some command.
thanx
---------- Post updated 02-05-10 at 09:31 AM ---------- Previous update was 02-04-10 at 01:50 PM ----------
Any idea...
Appreciate your assist
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello friends,
I have the following data:
abc-xyz
abc = 0-999
xyz = 0-999
and there are 10000 lines or more:
Example of data file:
123000
123001
123004
123005
123004
123004
123008
123008 (4 Replies)
Discussion started by: bobo
4 Replies
2. Shell Programming and Scripting
Hi,
I want to count how many rows are in a file for a specific column.
eg.
K NM
K NM
K NM
K JK
K NM
K JK
K NM
so the file is tab-delimited. I want to count how many rows are in column 2 and how many NMs there are.
I used awk
awk '{OFS="\t"}; {count++} {print i,... (3 Replies)
Discussion started by: phil_heath
3 Replies
3. Shell Programming and Scripting
Hi,
The following output shows how many pmon process are started by users named : oracle or yoavb
$ ps -ef |grep pmon |grep -v grep |grep -v ipmon
oracle 11268 1 0 Sep 2 ? 36:00 ora_pmon_qerp
oracle 17496 1 0 Oct 11 ? 8:58 ora_pmon_bcv
oracle 15081 1 0 ... (5 Replies)
Discussion started by: yoavbe
5 Replies
4. HP-UX
Executed the following if conditions .. and got different results .
only (( )) gave correct o/p with all scenarios .
Can anybody please let me know what is the difference between and ] and ((condition)) when used with if condition.
And why each condition gave different result.
1.... (2 Replies)
Discussion started by: soumyabubun
2 Replies
5. UNIX for Dummies Questions & Answers
Counting number of lines: sp
I am trying to figure out a script to count the number of text files in cywig and have it give me a number (as the answer) any help would be appreciated.
I am new here, so be gentle :D (3 Replies)
Discussion started by: unicksjp
3 Replies
6. Shell Programming and Scripting
hi,
I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command
Here are my simple script
After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies
7. UNIX for Dummies Questions & Answers
Hi all,
I promise this is my very last dumb question.. but how to you count how many unique names you have.
My dataset is:
>Bac1
afdsgrr
>Bac4
egege
>Bac8
dgrjh
>Bac1
afdsgrr
>Bac1
afdsgrr
>Bac8
dgrjh
What i want to know is that how many unique names there is, so the output would... (3 Replies)
Discussion started by: Iifa
3 Replies
8. Shell Programming and Scripting
.......... (1 Reply)
Discussion started by: Antonlee
1 Replies
9. Shell Programming and Scripting
Hi Unix team,
I have a file with 30 columns with tab delimited. I need to count the records based on column 18 & 21 data.
So I cut the data from the file using
awk -F"\t" '{print $18,$21}' foo.txt
Following is the output:
USED SEDAN
USED SUV
NEW SUV
USED Truck
USED Truck
USED... (6 Replies)
Discussion started by: karumudi7
6 Replies
10. Shell Programming and Scripting
HI
My doubt may be basic one but I need to get it clarified..
When i use "if" condition that checks for many AND, OR logical conditions
like
if ]; then
return 0
fi
Even the if condition fails it returns as zero.. Any clue..
But if i add else condition like
if ]; ... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies