plz help me with this, I want to to extract the duplicate rows (column 1) in a file which at least repeat 4 times. then I want to summarize them by getting the max , mean, median and min. The file is sorted by column 1, all the repeated rows appear together.
If number of elements is odd, median is middle one , eg 4th element among 7 sorted numbers ... element number (n+1)/2
If number of elements is even, it is the average of middle 2, eg. average of 4th and 5th element for set of 8 sorted numbers...average of n/2 + 1 and n/2
I figured our uniq -d option will give me the duplicate lines, but how do I work with at least 4?
Also, I tried to find the mean and median, getting errors but trying to get this to work.
hi all
can anyone please let me know if there is a way to find out duplicate rows in a file. i have a file that has hundreds of numbers(all in next row).
i want to find out the numbers that are repeted in the file.
eg.
123434
534
5575
4746767
347624
5575
i want 5575
please help (3 Replies)
I have searched the internet for duplicate row extracting.
All I have seen is extracting good rows or eliminating duplicate rows.
How do I extract duplicate rows from a flat file in unix.
I'm using Korn shell on HP Unix.
For.eg.
FlatFile.txt
========
123:456:678
123:456:678
123:456:876... (5 Replies)
Hi all,
I have written one shell script. The output file of this script is having sql output.
In that file, I want to extract the rows which are having multiple entries(duplicate rows).
For example, the output file will be like the following way.
... (7 Replies)
Hi! I have a file as below:
line1
line2
line2
line3
line3
line3
line4
line4
line4
line4
I would like to extract duplicate lines (not unique, triplicate or quadruplicate lines). Output will be as below:
line2
line2
I would appreciate if anyone can help. Thanks. (4 Replies)
Hi ,
I have a data file in this format.
p1 p2 p3
10 0
10 0 1000
I am using a sqlloader script to load the data into the database table.There is a unique constraint on the columns p1 and p2.
So, sqlldr cannot load both the records. This eliminates duplicate records from being... (1 Reply)
I feel stupid for asking this because it seems that MYSQL code isn't working the way that I think it should work.
Basically I wrote code like this:
select * from `Test_DC_Trailer` HAVING max(DR_RefKey);
Where the DR_RefKey is a unique numeric field that is auto iterated (like a primary key)... (7 Replies)
Hi all
I have a file that has two columns and I need the maximum value in column 2 of 4 positions o rows. for example at position {1..3} there are 4 characters (A, C, G and T) each of these characters with a value with a value in column 2. I need the maximum value in column 2 and the corresponding... (2 Replies)
I want to duplicate each row in my file
Egfile.txt
Name State Age
Jack NJ 34
John MA 23
Jessica FL 45
I want the code to produce this output
Name State Age
Jack NJ 34
Jack NJ 34
John MA 23
John MA 23
Jessica FL 45
Jessica FL 45 (6 Replies)
Hi,
I have a file that contains multiple records of the same database.
I need to search for the maximum size of the database. At the moment, I am doing as below:
Sample generated file to parse is as below. With the caret (^) delimiter, field 1 is the database name, 2 is the database ID and... (3 Replies)
Discussion started by: newbie_01
3 Replies
LEARN ABOUT DEBIAN
numaverage
NUMAVERAGE(1) User Contributed Perl Documentation NUMAVERAGE(1)NAME
numaverage - Find the average of a set of numbers.
SYNOPSIS
numaverage [-dhiIlmMV] <FILE>
| numaverage [-dhiIlmMV] (Input on STDIN from pipeline.)
numaverage [-dhiIlmMV] (Input on STDIN. Use Ctrl-D to stop.)
DESCRIPTION
By default numaverage will determine the average from all numbers on input. Other options allow you to find the mode and median.
OPTIONS -i Only return the integer portion of the final sum.
-I Only return the decimal portion of the final sum
-m Find the mode (most occuring) of the list of numbers,
or when there's more than one mode, the first completed mode.
-M Find the median (middle number) of the list of numbers.
-l When finding the median and the count of numbers in the set is even,
use the lower middle number instead of the upper middle number.
-h Help: You're looking at it.
-V Increase verbosity.
-d Debug mode. For developers
SEE ALSO numbound(1), numinterval(1), numnormalize(1), numgrep(1), numprocess(1), numsum(1), numrandom(1), numrange(1), numround(1)COPYRIGHT
numaverage is part of the num-utils package, which is copyrighted by Suso Banderas and released under the GPL license. Please read the
COPYING and LICENSE files that came with the num-utils package
Developers can read the GOALS file and contact me about providing
submitions or help for the project.
MORE INFO
More info on numaverage can be found at:
http://suso.suso.org/programs/num-utils/
perl v5.10.1 2009-10-31 NUMAVERAGE(1)