Sponsored Content
Top Forums UNIX for Dummies Questions & Answers count string occurance in a file hourly Post 302140515 by ayhanne on Saturday 13th of October 2007 10:47:06 AM
Old 10-13-2007
count string occurance in a file hourly

Hi! Sorry, I'm just new here and I'm not familiar on the rules. I want to count the ocurrance of like Asynchronous every hour. For example I want to have the count of Asynchronous in 0000H-0059H, 0100H-0159H, and so on. The original file has 24hours data. I have a script that runs everyday and get the the data for previous day. Thanks!

Sample output:
Asynchronous on 2007-10-12 from 0000H to 0059H is <total count>
Successful on 2007-10-12 from 0000H to 0059H is <total count>

Asynchronous on 2007-10-12 from 0100H to 0159H is <total count>
Successful on 2007-10-12 from 0100H to 0159H is <total count> ... and so on.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing the last occurance of string

I have a small query. I have a file containing the following lines abcd<12></12>fdfgdf<12>sdfgfg<12> sdfsdf<12></12>ytunfg<12> hggfhf<12>rtysb<12>zdfgdfg<12> Now I wish to delete ONLY the last occurance of string <12> from every lines of code. That mease my final output will be like this:... (7 Replies)
Discussion started by: dkhanna01
7 Replies

2. UNIX for Dummies Questions & Answers

Count of matched pattern occurance

In a file a pattern is occured many times randomly. Even it may appear more then once in the same line too. How i can get the number of times that pattern appeared in the file? let the file name is abc.txt and the pattern is "xyz". I used the following code: grep -ic "xyz" abc.txt but it is... (3 Replies)
Discussion started by: palash2k
3 Replies

3. Shell Programming and Scripting

How to insert values in 1st occurance out of two occurance in a file

Hi I have a file which contains the following two lines which are same But I would like to insert the value=8.8.8.8 in the 1st occurance line and value=9.9.9.9 in the 2nd occurance line. <parameter name="TestIp1" value=""> <parameter name="TestIp1" value=""> Please suggest (1 Reply)
Discussion started by: madhusmita
1 Replies

4. Shell Programming and Scripting

Count occurance of multiple strings using grep command

How to grep multiple string occurance in input file using single grep command? I have below input file with many IDP, RRBE messages. Out put should have count of each messages. I have used below command but it is not working grep -cH "(sent IDP Request)(Recv RRBCSM)" *.txt ... (5 Replies)
Discussion started by: sushmab82
5 Replies

5. UNIX for Dummies Questions & Answers

count the number of occurance and increment

Hi, I am trying to count the number of occurance of a specific value in a column and increment the variable in the second column accordingly. I have very little information about Unix. As an example, 21 1 32 1 32 2 45 1 56 1 56 2 56 3 73 1 82 1 Thanks, Natasha (2 Replies)
Discussion started by: natasha
2 Replies

6. Shell Programming and Scripting

how to grep string from hourly basis files

dear all, pls help on this script.. i have many files which will be created every mins in particular directory. i want to grep a particular string from only for unique hour files. from the below code i want to grep a string from only 9th hour files . Ex files: -rw-r--r-- 1 root ... (5 Replies)
Discussion started by: steve2216
5 Replies

7. Shell Programming and Scripting

replace every second occurance of a string

I want to replace every 2nd occurance of a string/character from a line. ababacbsbddbsbbcbdbssb i want to replace every s2nd b with @ like below should be like aba@acbs@ddbs@bc@dbss@ (3 Replies)
Discussion started by: ratheeshjulk
3 Replies

8. Shell Programming and Scripting

Search for a pattern in a String file and count the occurance of each pattern

I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported Input file is a free flowing file without any format example of output ERR-00001=5 .... ERR-01010=10 ..... ERR-99999=10 (4 Replies)
Discussion started by: swayam123
4 Replies

9. Shell Programming and Scripting

[Need help] perl script to find the occurance of string from a text file

I have two files 1. input.txt 2. keyword.txt input.txt has contents like .src_ref 0 "call.s" 24 first 0x000000 0x5a80 0x0060 BRA.l 0x60 .src_ref 0 "call.s" 30 first 0x000002 0x1bc5 RETI .src_ref 0 "call.s" 31 first 0x000003 0x6840 ... (2 Replies)
Discussion started by: acdc
2 Replies

10. UNIX for Beginners Questions & Answers

Insert text after the first occurance of searched string entry in a file

My server xml file has huge data part of which i'm sharing below. I wish to add the below text held by variable "addthisline" after the closing braces i.e --> once the first </Connector> tag is found. addthisline="I need to be inserted after the comments" Thus my searchstring is... (3 Replies)
Discussion started by: mohtashims
3 Replies
iopending(1m)							   USER COMMANDS						     iopending(1m)

NAME
iopending - plot number of pending disk events. Uses DTrace. SYNOPSIS
iopending [-c] [-d device] [-f filename] [-m mount_point] [interval [count]] DESCRIPTION
This samples the number of disk events that are pending and plots a distribution graph. By doing this the "serialness" or "parallelness" of disk behaviour can be distinguished. A high occurance of a pending value of more than 1 is an indication of saturation. Since this uses DTrace, only users with root privileges can run this command. OPTIONS
-c clear screen -d device instance name to snoop (eg, dad0) -f filename full pathname of file to snoop -m mount_point mountpoint for filesystem to snoop EXAMPLES
Default output, print I/O summary every 1 second, # iopending Print 10 second samples, # iopending 10 Print 12 x 5 second samples, # iopending 5 12 Snoop events on the root filesystem only, # iopending -m / FIELDS
value number of pending events, 0 == idle count number of samples @ 1000 Hz load 1 min load average disk_r total disk read Kb for sample disk_w total disk write Kb for sample IDEA
Dr Rex di Bona DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver- bose descriptions explaining the output. EXIT
iopending will run forever until Ctrl-C is hit, or the specified count is reached. AUTHOR
Brendan Gregg [Sydney, Australia] SEE ALSO
iosnoop(1M), iotop(1M), dtrace(1M) version 0.60 Nov 01, 2005 iopending(1m)
All times are GMT -4. The time now is 02:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy