05-22-2011
For a real quick solution, I would
(1) Put the data one on a line.
(2) Sort.
(3) Pass it to 'awk' with the required percentile value as a parameter.
(4) Use pattern $1 < parameter.
(5) For each record make it the minimum if needed.
(6) On END, print the value.
10 More Discussions You Might Find Interesting
1. AIX
How to replace many numbers with one number in a file.
Many numbers like 444565,454678,443298,etc. i want to replace these with one number (300).Please halp me out. (2 Replies)
Discussion started by: vpandey
2 Replies
2. Shell Programming and Scripting
. . . . . . (3 Replies)
Discussion started by: some124one
3 Replies
3. UNIX for Dummies Questions & Answers
I have two files one (numbers file)contains the numbers(approximately 30000) and the other file(record file) contains the records(approximately 40000)which may or may not contain the numbers from that file.
I want to seperate the records which has the field 1=(any of the number from numbers... (15 Replies)
Discussion started by: Shiv@jad
15 Replies
4. Shell Programming and Scripting
Howdy experts,
We have some ranges of number which belongs to particual group as below.
GroupNo StartRange EndRange
Group0125 935300 935399
Group2006 935400 935476
937430 937459
Group0324 935477 935549
... (6 Replies)
Discussion started by: thepurple
6 Replies
5. Shell Programming and Scripting
Hi all,
I have a large column of numbers like
5.6789
2.4578
9.4678
13.5673
1.6589
.....
I am trying to make an awk code so that awk can easily go through the column and arrange the numbers from least to highest like
1.6589
2.4578
5.6789
.......
can anybody suggest, how can I do... (5 Replies)
Discussion started by: ananyob
5 Replies
6. Programming
Input file:
#data_1
AGDG
#data_2
ADG
#data_3
ASDDG
DG
#data_4
A
Desired result:
Highest 7
Slowest 1
code that I try but failed to archive my goal :(
#include <stdio.h> (2 Replies)
Discussion started by: cpp_beginner
2 Replies
7. UNIX for Dummies Questions & Answers
##### (0 Replies)
Discussion started by: lucasvs
0 Replies
8. Shell Programming and Scripting
Hi, I have a list.txt file with number ranges and want to print/save new all.txt file with all the numbers and between the numbers.
== list.txt ==
65936
65938
65942 && 65943
65945 ... (7 Replies)
Discussion started by: AK47
7 Replies
9. Shell Programming and Scripting
Hi again. Sorry for all the questions — I've tried to do all this myself but I'm just not good enough yet, and the help I've received so far from bartus11 has been absolutely invaluable. Hopefully this will be the last bit of file manipulation I need to do.
I have a file which is formatted as... (4 Replies)
Discussion started by: crunchgargoyle
4 Replies
10. UNIX for Beginners Questions & Answers
Hi!
I found and then adapt the code for my pipeline...
awk -F"," -vOFS="," '{printf "%0.2f %0.f\n",$2,$4}' xxx > yyy
I add -F"," -vOFS="," (for input and output as csv file) and I change the columns and the number of decimal...
It works but I have also some problems... here my columns
... (7 Replies)
Discussion started by: echo manolis
7 Replies
HISTO(1) General Commands Manual HISTO(1)
NAME
histo - compute 1-dimensional histogram of N data columns
SYNOPSIS
histo [-c][-p] xmin xmax nbins
histo [-c][-p] imin imax
DESCRIPTION
Histo bins columnular data on the standard input between the given minimum and maximum values. If three command line arguments are given,
the third is taken as the number of data bins between the first two real numbers. If only two arguments are given, they are both assumed
to be integers, and the number of data bins will be equal to their difference plus one. The bins are always of equal size.
The output is N+1 columns of data (for N columns input), where the first column is the centroid of each division, and each row corresponds
to the frequencies for each column around that value.
If the -c option is present, then histo computes the cumulative histogram for each column instead of the straight frequencies. The upper
value of each bin is printed also instead of the centroid. This may be useful in computing percentiles, for example. Values below the
minimum specified are still counted in the cumulative total.
The -p option tells histo to report the percentage of the total number of input lines rather than the absolute counts. In the case of a
cumulative total, this yields the percentile values directly. Values above the maximum are counted as well as values below in this case.
All input data is interpreted as real values, and columns must be white-space separated. If any value is less than the minimum or greater
than the maximum, it will be ignored unless the -c option is specified.
EXAMPLE
To count data values between -1 and 1 in 50 bins:
histo -1 1 50 < input.dat
To count frequencies of integers between 0 and 255:
histo 0 255 < input.dat
AUTHOR
Greg Ward
SEE ALSO
cnt(1), neaten(1), rcalc(1), rlam(1), tabfunc(1), total(1)
RADIANCE
9/6/96 HISTO(1)