03-20-2014
Quote:
Originally Posted by
verse123
Hi Corona, I have sorted by a different column and would like to find the median as a function of another sort. That's why I don't need to necessarily sort col 3.
I don't see anything in your input or output that looks remotely like a median. I don't understand.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT DEBIAN
blockmedian
BLOCKMEDIAN(l) BLOCKMEDIAN(l)
NAME
blockmedian - filter to block average (x,y,z) data by L1 norm.
SYNOPSIS
blockmedian [ xyz[w]file(s) ] -Ix_inc[m|c][/y_inc[m|c]] -Rwest/east/south/north[r] [ -C ] [ -F ] [ -H[nrec] ] [ -L ] [ -Q ] [ -V ] [ -W[io]
] [ -: ] [ -bi[s][n] ] [ -bo[s][n] ]
DESCRIPTION
blockmedian reads arbitrarily located (x,y,z) triples [or optionally weighted quadruples (x,y,z,w)] from standard input [or xyz[w]file(s)]
and writes to standard output a median position and value for every non-empty block in a grid region defined by the -R and -I arguments.
Either blockmean, blockmedian, or blockmode should be used as a pre-processor before running surface to avoid aliasing short wavelengths.
These routines are also generally useful for decimating or averaging (x,y,z) data. You can modify the precision of the output format by
editing the D_FORMAT parameter in your .gmtdefaults file, or you may choose binary input and/or output using single or double precision
storage.
xyz[w]file(s)
3 [or 4] column ASCII file(s) [or binary, see -b] holding (x,y,z[,w]) data values. [w] is an optional weight for the data. If no
file is specified, blockmedian will read from standard input.
-I x_inc [and optionally y_inc] is the grid spacing. Append m to indicate minutes or c to indicate seconds.
-R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the
dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn.
OPTIONS
-C Use the center of the block as the output location [Default uses the median location (but see -Q)]. -C overrides -Q.
-F Block centers have pixel registration. [Default: grid registration.] (Registrations are defined in GMT Cookbook Appendix B on grid
file formats.) Each block is the locus of points nearest the grid value location. For example, with -R10/15/10/15 and and -I1: with
the -F option 10 <= (x,y) < 11 is one of 25 blocks; without it 9.5 <= (x,y) < 10.5 is one of 36 blocks.
-H Input file(s) has Header record(s). Number of header records can be changed by editing your .gmtdefaults file. If used, GMT default
is 1 header record. Not used with binary data.
-L Indicates that the x column contains longitudes, which may differ from the region in -R by [multiples of] 360 degrees [Default
assumes no periodicity].
-Q (Quicker) Finds median z and (x, y) at that z [Default finds median x, median y, median z].
-V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-W Weighted modifier[s]. Unweighted input and output has 3 columns x,y,z; Weighted i/o has 4 columns x,y,z,w. Weights can be used in
input to construct weighted median values in blocks. Weight sums can be reported in output for later combining several runs, etc.
Use -W for weighted i/o, -Wi for weighted input only, -Wo for weighted output only. [Default uses unweighted i/o]
-: Toggles between (longitude,latitude) and (latitude,longitude) input/output. [Default is (longitude,latitude)]. Applies to geo-
graphic coordinates only.
-bi Selects binary input. Append s for single precision [Default is double]. Append n for the number of columns in the binary file(s).
[Default is 3 (or 4 if -W is set) columns].
-bo Selects binary output. Append s for single precision [Default is double].
EXAMPLES
To find 5 by 5 minute block medians from the double precision binary data in hawaii_b.xyg and output an ASCII table, try
blockmedian hawaii_b.xyg -R198/208/18/25 -I5m -bi3 > hawaii_5x5.xyg
SEE ALSO
blockmean(1gmt), blockmode(1gmt), gmt(1gmt), gmtdefaults(1gmt), nearneighbor(1gmt), surface(1gmt), triangulate(1gmt)
1 Jan 2004 BLOCKMEDIAN(l)