Hi, I wanted to calculate cumulative frequency distribution of my data that involves several arithmetic calls. I did things in excel but its taking me forever. this is what I want to do:
Any help on this is very much appreciated. Bunch of thanks in advance.
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)
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)
Dear all,
i need your help on this. There is a text file, i need to count word frequency for each word with frequency >40 in each line of file and output it into another file with columns like this:
word1,word2,word3, ...wordn
0,0,1
1,2,0
3,2,0 etc -- each raw represents... (13 Replies)
I would like to extract a number from $0 and calculate if it can be devided by 25. Though the number can also be less then 25 or bigger than 100. How do i extract the number and how can the integer be calculated?
String:
"all_results">39</span>I am looking for the number between "all_results"> ... (5 Replies)
Hi, I am working with files containing 2 columns in which i need to come up with the frequency/count of values in col. 2 falling within specifics binned values of col. 1. the contents of a sample file is shown below:
15 12.5
15 11.2
16 0.2
16 1.4
17 1.6
18 4.5
17 5.6
12 8.6
11 7.2
9 ... (13 Replies)
Hi All,
IS there any 'awk' way to manipulate following data?
Fruit Date Count
Apple 20/08/2011 5
Apple 27/08/2011 7
Apple 05/09/2011 11
Apple 12/09/2011 3
Apple 19/09/2011 25
.
.
.
.
Orange 20/08/2011 9
Orange 27/08/2011 20
Orange 27/08/2011 7
Orange 05/09/2011 15
Orange... (3 Replies)
Hi All,
I have the following time stamp data in 2 columns
Date TimeStamp(also with milliseconds)
05/23/2012 08:30:11.250
05/23/2012 08:30:15.500
05/23/2012 08:31.15.500
.
.
etc
From this data I need the following output.
0.00( row1-row1 in seconds)
04.25( row2-row1 in... (5 Replies)
For the data
I would like to parse down and for each parsing
I want a cumulative averaging, stored in an array
that can be output.
I.e.
546/NR = 546
(546+344)/NR=(546+344)/2 = etc.
For N record input I want N values of the average (a block
averaging effectively)
Any... (3 Replies)
Discussion started by: chrisjorg
3 Replies
LEARN ABOUT LINUX
__ppc_get_timebase_freq
__PPC_GET_TIMEBASE(3) Linux Programmer'sManual __PPC_GET_TIMEBASE(3)NAME
__ppc_get_timebase, __ppc_get_timebase_freq - get the current value
of the Time Base Register on Power architecture and its frequency.
SYNOPSIS
#include <sys/platform/ppc.h>
uint64_t __ppc_get_timebase(void)
uint64_t __ppc_get_timebase_freq(void);
DESCRIPTION
__ppc_get_timebase() reads the current value of the Time Base Register and returns its value, while __ppc_get_timebase_freq() returns the
frequency in which the Time Base Register is updated.
The Time Base Register is a 64-bit register provided by Power Architecture processors. It stores a monotonically incremented value that is
updated at a system-dependent frequency that may be different from the processor frequency.
RETURN VALUE
__ppc_get_timebase() returns a 64-bit unsigned integer that represents the current value of the Time Base Register.
__ppc_get_timebase_freq() returns a 64-bit unsigned integer that represents the frequency at which the Time Base Register is updated.
VERSIONS
GNU C Library support for __ppc_get_timebase() has been provided since version 2.16 and __ppc_get_timebase_freq() has been available since
version 2.17.
CONFORMING TO
Both functions are nonstandard GNU extensions.
EXAMPLE
The following program will calculate the time, in microseconds, spent between two calls to __ppc_get_timebase().
Program source
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/platform/ppc.h>
/* Maximum value of the Time Base Register: 2^60 - 1.
Source: POWER ISA. */
#define MAX_TB 0xFFFFFFFFFFFFFFF
int
main(void)
{
uint64_t tb1, tb2, diff;
uint64_t freq = __ppc_get_timebase_freq();
printf("Time Base frequency = %"PRIu64" Hz
", freq);
tb1 = __ppc_get_timebase();
// Do some stuff...
tb2 = __ppc_get_timebase();
if (tb2 > tb1) {
diff = tb2 - tb1;
} else {
/* Treat Time Base Register overflow. */
diff = (MAX_TB - tb2) + tb1;
}
printf("Elapsed time = %1.2f usecs
",
(double) diff * 1000000 / freq );
exit(EXIT_SUCCESS);
}
SEE ALSO time(2), usleep(3)GNU C Library 2019-03-06 __PPC_GET_TIMEBASE(3)