Sponsored Content
Full Discussion: find frequency
Top Forums Shell Programming and Scripting find frequency Post 302686987 by mirni on Wednesday 15th of August 2012 07:47:29 PM
Old 08-15-2012
Try this:
Code:
 
awk '{
 c[$1]++; 
 if($1 < min) min=$1; 
 if($1 > max) max=$1;
}END{
  for(i=min; i<=max; i++){
     print i "-" (c[i]?c[i]:0) }
}' freqData.txt

 

9 More Discussions You Might Find Interesting

1. HP-UX

Frequency of CPU's on HP-UX server

Does anyone know if there is a command in hp-ux to find out the frequencies of the cpus on the server. I know in sun the command is /usr/sbin/psrinfo -v (on Sun)??Thanks (3 Replies)
Discussion started by: lnineill
3 Replies

2. Solaris

Monitor shows out of frequency

:confused: :( I had a Intel P4 2.6 HT pc with 256DDRAM. I installed solaris 10 with most of the default configuration by the system...now when i boot the system with solaris 10, after the boot screen is past and desktop login screen is about to appears the monitor goes down and displays "OUT OF... (0 Replies)
Discussion started by: sunilpatwal
0 Replies

3. HP-UX

How to find processor frequency

Hello , Please tell me how to find processor frequency in HP UNIX . (8 Replies)
Discussion started by: manjunath
8 Replies

4. Solaris

out of frequency

:cool: after installing solaris 10 5/08/09 directory the computer rebooting then the massage "out of frequency" appear.i want a solution first second my main board is GA-MA780G UD3H (14 Replies)
Discussion started by: medo2008
14 Replies

5. Shell Programming and Scripting

Counting commands frequency

I'd like to create a script that keeps track of the commands used. For example: count ls ps and from now on whenever I use ls or ps a counter is increased. I want that after the command count has been activated a session starts(here I can use any commands) and I want to stop the session... (5 Replies)
Discussion started by: Max89
5 Replies

6. Shell Programming and Scripting

Sorting value frequency within an array

How is it possible to sort different nummeric values within an Array. But i don`t want the highest or the lowest. I need the most frequently occurring value. For examble: My Array has to following values = (200 404 404 500 404 404 404 200 404) The result should be 404 The values are... (3 Replies)
Discussion started by: 2retti
3 Replies

7. Shell Programming and Scripting

Calculating cumulative frequency

Hi, I have a file containing the frequency's of an element sorted in ascending order. The file looks something like this: #Element Frequency 1 1 2 1 3 1 4 1 5 1 6 ... (5 Replies)
Discussion started by: sajal.bhatia
5 Replies

8. Shell Programming and Scripting

Bash - Same frequency

Hi, Could anyone help me with the following question, if I have two colums (names and frequency) as follows in a file called name.txt Michael 1 Jones 1 Ben 2 Rebeca 4 David 1 and I want to use bash script called freqnames.sh that takes one argument (name) and the output should be... (3 Replies)
Discussion started by: jboy
3 Replies

9. Shell Programming and Scripting

frequency count using shell

Hello everyone, please consider the following lines of a matrix 59 32 59 32 59 32 59 32 59 32 59 32 59 32 60 32 60 33 60 33 60 33 60 33 60 33 60 33 60 33 60 33 60 33 (7 Replies)
Discussion started by: xshang
7 Replies
mlib_VectorMinimum_U8(3MLIB)				    mediaLib Library Functions				      mlib_VectorMinimum_U8(3MLIB)

NAME
mlib_VectorMinimum_U8, mlib_VectorMinimum_S8, mlib_VectorMinimum_S16, mlib_VectorMinimum_S32, mlib_VectorMinimum_F32, mlib_VectorMini- mum_D64 - find the minimum value in a vector SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_VectorMinimum_U8(mlib_u8 *min, const mlib_u8 *x, mlib_s32 n); mlib_status mlib_VectorMinimum_S8(mlib_s8 *min, const mlib_s8 *x, mlib_s32 n); mlib_status mlib_VectorMinimum_S16(mlib_s16 *min, const mlib_s16 *x, mlib_s32 n); mlib_status mlib_VectorMinimum_S32(mlib_s32 *min, const mlib_s32 *x, mlib_s32 n); mlib_status mlib_VectorMinimum_F32(mlib_f32 *min, const mlib_f32 *x, mlib_s32 n); mlib_status mlib_VectorMinimum_D64(mlib_d64 *min, const mlib_d64 *x, mlib_s32 n); DESCRIPTION
Each of these functions finds the minimum value of all elements in a vector. The following equation is used: max[0] = MIN{ x[i] i = 0, 1, ..., (n - 1) } PARAMETERS
Each of the functions takes the following arguments: min Pointer to the minimum value. x Pointer to the first element of the source vector. n Number of elements in the source vector. RETURN VALUES
Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_VectorMaximum_U8(3MLIB), mlib_MatrixMaximum_U8(3MLIB), mlib_MatrixMinimum_U8(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_VectorMinimum_U8(3MLIB)
All times are GMT -4. The time now is 07:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy