Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Median calculator based on id match Post 302893572 by verse123 on Thursday 20th of March 2014 01:16:05 AM
Old 03-20-2014
Precisely Don. The file has already been sorted by the columns you mentioned. Sorting isn't really the issue here though. The issue is finding the median for all strings in col1 that share an ID, writing that answer for all lines that have that ID, and performing the same thing for a new string. I notice now the output example I gave is not very clear. It should look like this


Code:
id   col2   col3  median
dog   0       0          3      
dog   1       4          3
dog   2       3          3
cat    0       2          4
cat    1       6          4

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split a record based on particular match

Hi , I have a requirement to split the record based on particular match using UNIX. Case1: Input Record : 10.44.48.63;"Personals/Dating;sports";1441 Output Records : 10.44.48.63;Personals/Dating;1441;Original 10.44.48.63;sports;1441;Dummy Case2: Input Record : ... (5 Replies)
Discussion started by: mksuneel
5 Replies

2. Shell Programming and Scripting

Awk based script to find the median of all individual columns in a data file

Hi All, I have some data like below. Step1,Param1,Param2,Param3 1,2,3,4 2,3,4,5 2,4,5,6 3,0,1,2 3,0,0,0 3,2,1,3 ........ so on Where I need to find the median(arithmetic) of each column from Param1...to..Param3 for each set of Step1 values. (Sort each specific column, if the... (5 Replies)
Discussion started by: ks_reddy
5 Replies

3. UNIX for Dummies Questions & Answers

Display/Cut the characters based on match

I have input file like this update tablename set column1='ABC',column2='BBC' where columnx=1 and columny=100 and columnz='10000001' update tablename set column1='ABC',column2='BBC',column3='CBC' where columnx=1 and columny=100 and columnz='10000002' update tablename set column1='ABC' where... (1 Reply)
Discussion started by: nsuresh316
1 Replies

4. Shell Programming and Scripting

Match files based on either of the two columns awk

Dear Shell experts, I have 2 files with structure: File 1: ID and count head test_GI_count1.txt 1000094 2 10039307 1 10039641 1 10047177 11 10047359 1 1008555 2 10120302 1 10120672 13 10121776 1 10121865 32 And 2nd file: head Protein_gi_GeneID_symbol.txt protein_gi GeneID... (11 Replies)
Discussion started by: smitra
11 Replies

5. UNIX for Advanced & Expert Users

Match and print based on columns

HI, I have 2 different questions in this thread. Consider 2 files as input (input file have different line count ) File 1 1 1 625 56 1 12 657 34 1 9 25 45 1 2 20 54 67 3 25 35 27 4 45 73 36 5 125 56 45 File2 1 1 878 76 1 9 83 67 2 20 73 78 4 47 22 17 3 25 67 99 (4 Replies)
Discussion started by: rossi
4 Replies

6. Shell Programming and Scripting

New files based off match or no match

Trying to match $2 in original_targets with $2 of new_targets . If the two numbers match exactly then a match.txt file is outputted using the information in the new_targets in the beginning 4 fields $1, $2, $3, $4 and value of $4 in the original_targets . If there is "No Match" then a no... (2 Replies)
Discussion started by: cmccabe
2 Replies

7. Shell Programming and Scripting

Match based on criteria to file

Trying to match $1 of target.txt to $5 of file.txt. If there is a match then in an output.txt file $1,$1 (row underneath),$6,$4,$7 from file.txt are printed on the same line as $1 of target.txt. The input is from excel and the output should be tab-deliminated. Thank you :). target.txt... (2 Replies)
Discussion started by: cmccabe
2 Replies

8. Shell Programming and Scripting

Merge lines based on match

I am trying to merge two lines to one based on some matching condition. The file is as follows: Matches filter: 'request ', timestamp, <HTTPFlow request=<GET: Matches filter: 'request ', timestamp, <HTTPFlow request=<GET: Matches filter: 'request ', timestamp, <HTTPFlow ... (8 Replies)
Discussion started by: jamie_123
8 Replies

9. Shell Programming and Scripting

awk to update file based on partial match in field1 and exact match in field2

I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output. $1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. UNIX for Beginners Questions & Answers

Data match 2 files based on first 2 columns matching only and join if match

Hi, i have 2 files , the data i need to match is in masterfile and i need to pull out column 3 from master if column 1 and 2 match and output entire row to new file I have tried with join and awk and i keep getting blank outputs or same file is there an easier way than what i am... (4 Replies)
Discussion started by: axis88
4 Replies
yuvdenoise(1)							MJPEG tools manual						     yuvdenoise(1)

NAME
yuvdenoise - Motion-Compensating-YUV4MPEG2-frame-denoiser SYNOPSIS
yuvdenoise [options] </dev/stdin >/dev/stdout DESCRIPTION
yuvdenoise is a spatio-temporal noise-filter for YUV4MPEG2 streams. This is useful to reduce the bitrate needed to encode your captured movies for VCD and SVCD creation. OPTIONS
yuvdenoise accepts the following options: -g y,u,v [0..255] Gaussian filter thresholds This sets the thresholds for the gaussian filter. A value of 0 disables filtering for a specific component and 0,0,0 completely dis- ables/bypasses the filter. This filter is applied before the temporal (-t) filter. (default=0,0,0) -m y,u,v [0..255] Pre 3D Median filter thresholds This sets the thresholds for the pre-processing 3D median filter. A value of 0 disables median filtering for a specific component and 0,0,0 completely disables/bypasses the filter. This filter is applied before the temporal (-t) filter. (default=0,0,0) -r y,u,v [0..255] Renoising filter thresholds This sets the thresholds for adding random "noise" back into the video stream. Default is disabled (not adding random noise). This filter, if enabled, is run as the Blast filter (after the median and temporal filters). Reasonable value is 4,8,8 but if you are work- ing with monochrome (black and white movie) then 4,0,0 will speed things up by not processing the chroma planes. (default=0,0,0) -t y,u,v [0..255] Temporal noise-filter thresholds This sets the thresholds for the temporal noise-filter. Values above 12 may introduce ghosting. The default value for Y' (y) is often a little high and reducing it to 4 or 5 may be necessary. If the chroma smears or ghosts try using values of 5 or 6 instead of the default (12). A value of 0 disables temporal filtering for the specified component (0,0,0 disables/bypasses all temporal filtering). Thus for black and white movies 4,0,0 will be faster by not denoising the chroma planes. (default=4,8,8) -M y,u,v [0..255] Post 3D Median filter thresholds This sets the thresholds for the post-processing 3D median filter. A value of 0 disables median filtering for a specific component and 0,0,0 completely disables/bypasses the filter. This filter is applied after the temporal (-t) filter. Reasonable value is 4,8,8 but if you are working with monochrome (black and white movie) then 4,0,0 will speed things up by not processing the chroma planes. (default=0,0,0) HOW IT WORKS
To Be Written (maybe) in the future. TYPICAL USAGE AND TIPS
As it is self-adapting to the noise-situation found in the stream you normally just can go without any options set: lav2yuv my-video.avi | yuvdenoise | mpeg2enc -t 1 -o my-video.m1v AUTHOR
This man page was written by Stefan Fendt <stefan@lionfish.ping.de> and revised by Steven Schultz. ADDITIONAL INFO
If you have questions, remarks, problems or you just want to contact the developers, the main mailing list for the MJPEG-tools is: mjpeg-users@lists.sourceforge.net For more info, see our website at http://mjpeg.sourceforge.net/ SEE ALSO
mjpegtools(1), mpeg2enc(1) lavrec(1) lav2yuv(1) MJPEG Linux Square 11th August 2005 yuvdenoise(1)
All times are GMT -4. The time now is 07:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy