Sponsored Content
Top Forums Shell Programming and Scripting Determine the frequency of each number within a text file Post 302669371 by it5ju5talx on Wednesday 11th of July 2012 02:07:53 AM
Old 07-11-2012
MySQL Determine the frequency of each number within a text file

I'd like to determine the frequency that each number occurs within a text file. I know how to do this for a single number, but not for a set or list of numbers. Here's what I have
Code:
  grep -o 01 file.txt | wc -l

Also, it's important that the numbers are two digits instead of 1, meaning that single digit numbers should begin with a 0.

Thank you
 

10 More Discussions You Might Find Interesting

1. HP-UX

determine number of xterm connected

i more than one hp-ux 11.0 application server. some of these application server has an xterminal attached to them. ncd900 and ncd400. i would like to know how many xterm is connected to an application server. without physically checking each xterm, can i identify how many xterm? thanks alot. (0 Replies)
Discussion started by: inquirer
0 Replies

2. Shell Programming and Scripting

$A is a number / any other string? How to determine ?

I have a variable (say $A) and while passing it gets either a number or some other string. Now how can test (with if else) whether the variable is just a ne or something else ? Thanks a lot to all in advance C Saha (2 Replies)
Discussion started by: csaha
2 Replies

3. Shell Programming and Scripting

AWK script: decrypt text uses frequency analysis

Ez all! I have a question how to decrypt text uses letter frequency analysis. I have code which count the letters, but what i need to do after that. Can anybody help me to write a code. VERY NEEDED! My code now: #!/usr/bin/awk -f BEGIN { FS="" } { for (i=1; i <= NF; i++) { if ($i... (4 Replies)
Discussion started by: SerJel
4 Replies

4. Shell Programming and Scripting

Determine Number of Processes Running

I am pretty new to unix, and I have a project to do. Part of the project asks me to determine the number of processes running and assign it to a variable. I know how to every part of the project but determine the number of processes running. How can I get just the number of processes... (4 Replies)
Discussion started by: wayne1411
4 Replies

5. Shell Programming and Scripting

Determine number of checklist in zenity dynamically...

Hi, In my Shell Script i am counting the duplicate IPs in LAN,...After counting i have to show in checklist in zenity which one to delete from the LAN........so initially i dont know no. of duplicate IPs in the LAN....Hence i can determine how many check list needed..... Duplicate IPs... (3 Replies)
Discussion started by: shivarajM
3 Replies

6. UNIX for Advanced & Expert Users

How to determine the number of NFS threads RUNNING on the system

Hi, Anyone can tell me how to get the number of NFS threads RUNNING on the system for Solaris 10? Someone told me for Solaris 9, the method is "echo "*svc$<svcpool" | adb -k. But, I've tried to google the method for Solaris 10 and did not find the corresponding method, please help... (1 Reply)
Discussion started by: wang.caiqi
1 Replies

7. Shell Programming and Scripting

decrease number by 1 in text file

i have text file which contains number like 234565 i need a shell script or command which decrease number by 1 in text file. pls (2 Replies)
Discussion started by: reyazan
2 Replies

8. Shell Programming and Scripting

determine the number of spaces

Here is a weird question :) i am trying to create a script written in bash that will create configuration files for nagios. As some of you aware is has to be written in the below format: define service{ option1 value1 option2 value2... (6 Replies)
Discussion started by: ppolianidis
6 Replies

9. Shell Programming and Scripting

editing line in text file adding number to value in file

I have a text file that has data like: Data "12345#22" Fred ID 12345 Age 45 Wilma Dino Data "123#22" Tarzan ID 123 Age 33 Jane I need to figure out a way of adding 1,000,000 to the specific lines (always same format) in the file, so it becomes: Data "1012345#22" Fred ID... (16 Replies)
Discussion started by: say170
16 Replies

10. UNIX for Beginners Questions & Answers

How do I determine the best number to use for the bs (block size) operand of the dd command?

When I create a bootable Linux distro installation USB drive, I use this command: sudo dd if=/Path/to/linux_distro.iso of=/dev/rdisk<disk number> bs=<number of bytes> When I look it up, I've seen variations of people choosing 4M, and I think 8M, 2M, and maybe even 1M. If I leave the operand... (4 Replies)
Discussion started by: Quenz
4 Replies
CWNNSTAT(1)						      General Commands Manual						       CWNNSTAT(1)

NAME
cwnnstat - To show the current status of cserver. SYNOPSIS
cwnnstat [-w] [-e] [-E] [-f] [-F] [-d] [-D] [-L lang ] [ hostname ] DEFAULT PATH
/usr/local/bin/cWnn4/cwnnstat DESCRIPTION
To request for the current execution status of the cserver for the current host. If hostname is specified, the status of the that specified host will be given. OPTIONS
-w To list the username, hostname, socket number and the environment number. -e To list the environment number, environment name and reference count. -E To list the environment number, environment name, reference count, grammar file number, number of dictionary used, (list of dictio- nary numbers) and the numbers of the files used in the current environment. -f To list the file ID of each cWnn file in the cserver, the file type, the location of file, reference count and the filename. -F Same as -f option -d To list the dictionary number of dictionaries managed by the host, the dictionary type, dictionary file number, dictionary filename, usage frequency filename and usage frequency file number. -D To list the dictionary number, type, conversion method, number of entries, static/dynamic, current usage status, priority, alias, filename, [(alias:usage frequency filename)], [password (frequency password)] of the dictionaries. -L To specify the language name which is referred during selection of cserver. If no lang is specified, the one specified by the envi- ronment variable LANG will be used. The default is "zh_CN". NOTE
1. The command options inside [ ] shown in the Command Format indicates that they are optional. If they are not required, "cwnnstat" alone is sufficient to obtain the status of cserver. 2. Dictionary number is different from file number. - File number refers to the standardized number among all cWnn files. - Dictionary number refers to the logical dictionary number in the server. 3. One dictionary file may consist of different usage frequency files, and each will form an individual dictionary. 4. One dictionary file with different conversion methods (forward/reverse) will form different dictionaries. 13 May 1992 CWNNSTAT(1)
All times are GMT -4. The time now is 04:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy