10-31-2008
Word Count for a range of text
Help Please!
I have alot of text that I would like to count for a range of text.
logevents.1:<190> Oct 30 02:59:42 N/A [23]: 6|4145|RC|CAC: Terminated
logevents.1:<190> Oct 30 02:59:42 N/A [23]: 6|4097|RC|CAC: Deleted
logevents.1:<190> Oct 30 02:59:44 N/A [36]: 6|4145|RC|CAC: Terminated
logevents.1:<190> Oct 30 02:59:44 N/A [36]: 6|4097|RC|CAC: Deleted
logevents.1:<190> Oct 30 02:59:46 N/A [23]: 6|4096|RC|CAC: Created
logevents.1:<190> Oct 30 03:00:01 N/A [36]: 6|4096|RC|CAC: Created
logevents.1:<190> Oct 30 03:00:05 N/A [23]: 6|4145|RC|CAC: Terminated
logevents.1:<190> Oct 30 03:00:05 N/A [23]: 6|4097|RC|CAC: Deleted
logevents.1:<190> Oct 30 03:00:06 N/A [36]: 6|4145|RC|CAC: Terminated
logevents.1:<190> Oct 30 03:00:06 N/A [36]: 6|4097|RC|CAC: Deleted
logevents.1:<190> Oct 30 03:00:06 N/A [23]: 6|4145|RC|CAC: Terminated
I would like to count how many times per hour the word Created showed up.
So I guess I am looking for something that will search on Oct 30 00 through Oct 30 23 that also had the word Created on that line.
any help would be great, thanks
Brian
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
given a file
i need to get the first line and secodn line
and count each of the line whether the length of first line and second line is the same
i don;t know how to get the length of the line...seems like use 'wc' cannot do it...
please advice (1 Reply)
Discussion started by: ariuscy
1 Replies
2. Shell Programming and Scripting
Greetings.
I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file.
I'm struggling to see how each line can be... (5 Replies)
Discussion started by: tricky
5 Replies
3. UNIX for Dummies Questions & Answers
Hi All,
Please let me know how to get the count of a particular word in a file. Example. I am looking for count of word 'result' in a file abc.xml.
Thanks,
Shankar (10 Replies)
Discussion started by: s_chowhan
10 Replies
4. Shell Programming and Scripting
Hi all, I am trying to write a command that can help me count the number of lines in the /etc/passwd file ending in bash.
I have read through other threads but am yet to find one indicating how to locate a specifc word at the end of a line. I know i will need to use the wc command but when i... (8 Replies)
Discussion started by: warlock129
8 Replies
5. UNIX for Advanced & Expert Users
Script that lists all words used in one or more files and displays their count (pattern /\W+/ to split the lines of the input file into words can b used)..
It should display list in format word:count...gets Filename as an cmd line argument!
eg: $perl test doc (where doc is d file we are going to... (4 Replies)
Discussion started by: aadi_uni
4 Replies
6. UNIX for Dummies Questions & Answers
Hi, been searching Google for like an hour and I doubt I got the right keywords so might as well ask here.
What I need:
Before:
Article1.txt 564
Article2.txt 799
Article3.txt 349
Article4.txt 452
* Separate files over 400 wordcount *
After:
Article1.txt 564... (3 Replies)
Discussion started by: Richard2000
3 Replies
7. UNIX for Dummies Questions & Answers
Hi I have a data file with two columns which looks like:
1 42
2 40
3 55
4 50
5 38
6 49
7 33
8 46
9 39
10 33
11 33
12 26
13 46
14 44
15 55
16 54
17 30
18 32 (7 Replies)
Discussion started by: marhuu
7 Replies
8. Shell Programming and Scripting
Dear all,
I have numerous dat files (1.dat, 2.dat...) containing 500 numeric values each. I would like to count them, based on their range and obtain a histogram or a counter.
INPUT:
1.dat
1.3
2.16
0.34
......
2.dat
1.54
0.94
3.13
.....
... (3 Replies)
Discussion started by: chen.xiao.po
3 Replies
9. Shell Programming and Scripting
I have a file which has users having different values against them in second column.
I want to set a range and get the count of users in that range.
Suppose :-
a 4
b 19
c 27
d 87
e 123
And I define the range like 1-20 , 20 -50 and so on..... Please assume the... (1 Reply)
Discussion started by: Sanjeev Yadav
1 Replies
10. UNIX for Beginners Questions & Answers
I am trying to figure out to find word count of each word from my file
sample file
hi how are you
hi are you ok
sample out put
hi 1
how 1
are 1
you 1
hi 1
are 1
you 1
ok 1
wc -l filename is not helping , i think we will have to split the lines and count and then print and also... (4 Replies)
Discussion started by: mirwasim
4 Replies