11-28-2007
Count number of occurences of a word
I want to count the number of occurences of say "200" in a file but that file also contains various stuff including dtaes like 2007 or smtg like 200.1 so count i am getting by doing grep -c "word" file is wrong
Please help!!!!!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi ,
I am using SUN OS Version 5.6.
I have a file that contains records of length 270. when I do 'set nu' in vi editor, I get the count as 86. whereas when I do "wc -l" on the command prompt, it shows the count as only 85. this is very strange. why would the 'wc' show 1 record less. The job... (3 Replies)
Discussion started by: tselvanin
3 Replies
2. UNIX for Dummies Questions & Answers
Hello,
I want to count the occurences of a specific word in a .txt file in bash shell.
Can somebody help me pleaze??
Thanks!!! (2 Replies)
Discussion started by: mskart
2 Replies
3. Shell Programming and Scripting
Hi all,
I have a pattern like this in a file:
123 4 56 789
234 5 67 789
121 3 56 789
222 4 65 789
321 6 90 100
478 8 40 789
243 7 80 789
How can I count the number of occurences of '789' (4th column) in this set...?
Thanks for all your help!
K (7 Replies)
Discussion started by: kripssmart
7 Replies
4. Shell Programming and Scripting
Hi all
Can anybody suggest me, how to get the count of digits in a word
I tried
WORD=abcd1234
echo $WORD | grep -oE ] | wc -l
4
It works in bash command line, but not in scripts :mad: (12 Replies)
Discussion started by: ./hari.sh
12 Replies
5. Shell Programming and Scripting
I am a newbie in UNIX shell script and seeking help on this UNIX function. Please give me a hand. Thanks.
I have a large file. Named as 'MyFile'. It was tab-delmited. I am told to write a shell function that counts the number of occurrences of the ord “mysring” in the file 'MyFile'. (1 Reply)
Discussion started by: duke0001
1 Replies
6. Shell Programming and Scripting
im trying to count the number of occurences of column 2 value(starting from KKK*) of the below file, file.txt
using the code cat file.txt | awk ' BEGIN { print "Category Counts"} {FS=","} {NR > 2} { cats = cats + 1} END { for(c in cats) { print c, "=", cats} } '
but its returning as
... (6 Replies)
Discussion started by: michaelrozar17
6 Replies
7. UNIX for Dummies Questions & Answers
Hello world,
Can anybody tell me how to count how many times does a word repeat in a file? There have been many threads on this but they all are heavy loads of Scripting for a starter like me. :D
So, I sat down today and after some hours of reading man pages, I found a simple one-line... (18 Replies)
Discussion started by: satish51392111
18 Replies
8. Shell Programming and Scripting
Hi Guys,
I have 2 files like below
file1
xx
yy
file2
b
yy
b2
xx
c1
yy
xx
yy
Now I want an idea which can count occurences of text from file1 and file2 so outbout would be kind of (9 Replies)
Discussion started by: prashant2507198
9 Replies
9. Shell Programming and Scripting
I have some files as shown below
GLL ALM 654-656 654 656
SEM LYG 655-657 655 657
SEM LYG 655-657 655 657
ALM LEG 656-658 656 658
ALM LEG 656-658 656 658
ALM LEG 656-658 656 658
LEG LEG 658-660 658 660
LEG LEG 658-660 658 660 The value of GLL is... (5 Replies)
Discussion started by: arch
5 Replies
10. UNIX for Beginners Questions & Answers
Hi, I would like to count the number of ALA occurences without having them to be repeated. In the script I have written now it has 40 repetitions of ALA but it has to be 8. ALA is chosen as one of the 20 values it can have when the script asks for the input of AAA, which for this example is chosen... (7 Replies)
Discussion started by: Aurimas
7 Replies
LEARN ABOUT DEBIAN
arpsend
arpsend(8) Containers arpsend(8)
NAME
arpsend - send ARP requests
SYNOPSIS
arpsend -D -e target_ip [ -e target_ip ...] [-c count] [-w timeout] interface
arpsend -U -i source_ip [-c count] [-w timeout] interface
DESCRIPTION
Utility arpsend sends ARP packets on device interface to detect or update neighbours' ARP caches with a given IP.
COMMANDS
Run utility with one of the following commands:
-D Send broadcast ARP request to detect neighbours with target_ip. You have to specify target_ip (-e option).
-U Send broadcast ARP request to update neighbours' ARP caches with source_ip. You have to specify source_ip (-i option).
OPTIONS
-c count
Number of packets to send. Default is infinity.
-w interval
Interval between packets, in seconds. Default is 1 second.
-i source_ip_address
Set source IP address field in ARP packet.
-e target_ip_address
Set target IP address field in ARP packet. Note that you can specify -e option multiple times to detect many IP addresses in one
utility call.
EXIT STATUS
arpsend returns 0 upon successful execution. If something goes wrong, it returns an appropriate error code.
1 EXC_USAGE
Usage error
2 EXC_SYSTEM
System error
3 EXC_RECV
ARP reply was received
EXAMPLES
To send request on interface eth0 to detect any neighbour computers with IP 192.168.10.200:
arpsend -D -e 192.168.10.200 eth0
To send request on interface eth0 to update neighbours' ARP caches with IP 192.168.10.200:
arpsend -U -i 192.168.10.200 eth0
NOTES
Interface you use have to be arpable and not be loopback (i.e. /sbin/ip link show interface should show neither NOARP nor LOOPBACK flags
in interface parameters).
SEE ALSO
vzctl(8).
LICENSE
Copyright (C) 2000-2011, Parallels, Inc. Licensed under GNU GPL.
OpenVZ 28 Jun 2011 arpsend(8)