Complicated is OK. Usually the complication goes away after correctly describing the problem. Just as a general suggestion: more than 30 years in IT have proven to me, over and over, that once a problem is correctly defined and stated the solution is in most cases obvious and a direct outcome of the problem definition.
Coming back from general aspects to your problem at hand: you want for every group of lines which have the same values in the second, thrid, fourth, fifth and sixth column only the first line to be printed and all others suppressed yes?
Question: is white space delimiting the columns to be considered, i.e are the lines
considered to be equal or not? Or can't that happen?
Yodas solution, for instance, may be working for you or not, depending on your answer to this question.
Are there leading/trailing whitespace in the lines? Need they to be taken into account or not? Will the white space always be formed by the same character or might there be space and tabs mixed? Are your values always numeric or might they be alphanumeric?
Hi,
I have this scenario; where there are two classes:- apple and orange.
1,2,3,4,5,6,apple
1,1,0,4,2,3,apple
1,3,3,3,3,4,apple
1,1,1,1,1,1,orange
1,2,3,1,1,1,orange
Basically for apple, i have 3 entries in the file, and for orange, I have 2 entries. Im trying to edit the file and find... (5 Replies)
Hi, my dilemna is this:
example i got a file of fruit.txt which contains:
Apple 6
Apple_new 7
old_orange 9
orange 10
Is there any way for me to have an output of
Apple 13
Orange 19
using shell script: (6 Replies)
Hello,
I have a log file with the following input:
X , ID , Date, Time, Y
01,01368,2010-12-02,09:07:00,Pass
01,01368,2010-12-02,10:54:00,Pass
01,01368,2010-12-02,13:07:04,Pass
01,01368,2010-12-02,18:54:01,Pass
01,01368,2010-12-03,09:02:00,Pass
01,01368,2010-12-03,13:53:00,Pass... (12 Replies)
Hello again, I am wanting to remove all duplicate blocks of XML code in a file. This is an example:
input:
<string-array name="threeItems">
<item>item1</item>
<item>item2</item>
<item>item3</item>
</string-array>
<string-array name="twoItems">
<item>item1</item>
<item>item2</item>... (19 Replies)
Hi
My file have 7 column, FIle is pipe delimed
Col1|Col2|col3|Col4|col5|Col6|Col7
I want to find out uniq record count on col3, col4 and col2 ( same order) how can I achieve it.
ex
1|3|A|V|C|1|1
1|3|A|V|C|1|1
1|4|A|V|C|1|1
Output should be
FREQ|A|V|3|2
FREQ|A|V|4|1
Here... (5 Replies)
I met a challenge to filter ~70 millions of sequence rows and I want using awk with conditions:
1) longest string of each pattern in column 2, ignore any sub-string, as the index;
2) all the unique patterns after 1);
3) print the whole row;
input:
1 ABCDEFGHI longest_sequence1
2 ABCDEFGH... (12 Replies)
Within a shell script I use
uniq -w 16 -D
in order to process all lines in which the first 16 characters are duplicated.
Now I want to also run that script on a BSD based system where the included version of uniq does not support the -w (--check-chars) option. To get around this I have... (7 Replies)
Hi again,
I have files with the following contents
datetime,ip1,port1,ip2,port2,number
How would I find out how many times ip1 field shows up a particular file? Then how would I find out how many time ip1 and port 2 shows up?
Please mind the file may contain 100k lines. (8 Replies)
Hi all
I was wondering if you may help me in resolving an issue.
In particular I have a file like this:
the ... represent different string and what I wrote Cur or Ent are the constant.
Well, what I would like to obtain is a file in which are reported only the ID in which the second column... (6 Replies)
Discussion started by: giuliangiuseppe
6 Replies
LEARN ABOUT REDHAT
sggglm
SGGGLM(l) ) SGGGLM(l)
NAME
SGGGLM - solve a general Gauss-Markov linear model (GLM) problem
SYNOPSIS
SUBROUTINE SGGGLM( N, M, P, A, LDA, B, LDB, D, X, Y, WORK, LWORK, INFO )
INTEGER INFO, LDA, LDB, LWORK, M, N, P
REAL A( LDA, * ), B( LDB, * ), D( * ), WORK( * ), X( * ), Y( * )
PURPOSE
SGGGLM solves a general Gauss-Markov linear model (GLM) problem:
minimize || y ||_2 subject to d = A*x + B*y
x
where A is an N-by-M matrix, B is an N-by-P matrix, and d is a given N-vector. It is assumed that M <= N <= M+P, and
rank(A) = M and rank( A B ) = N.
Under these assumptions, the constrained equation is always consistent, and there is a unique solution x and a minimal 2-norm solution y,
which is obtained using a generalized QR factorization of A and B.
In particular, if matrix B is square nonsingular, then the problem GLM is equivalent to the following weighted linear least squares problem
minimize || inv(B)*(d-A*x) ||_2
x
where inv(B) denotes the inverse of B.
ARGUMENTS
N (input) INTEGER
The number of rows of the matrices A and B. N >= 0.
M (input) INTEGER
The number of columns of the matrix A. 0 <= M <= N.
P (input) INTEGER
The number of columns of the matrix B. P >= N-M.
A (input/output) REAL array, dimension (LDA,M)
On entry, the N-by-M matrix A. On exit, A is destroyed.
LDA (input) INTEGER
The leading dimension of the array A. LDA >= max(1,N).
B (input/output) REAL array, dimension (LDB,P)
On entry, the N-by-P matrix B. On exit, B is destroyed.
LDB (input) INTEGER
The leading dimension of the array B. LDB >= max(1,N).
D (input/output) REAL array, dimension (N)
On entry, D is the left hand side of the GLM equation. On exit, D is destroyed.
X (output) REAL array, dimension (M)
Y (output) REAL array, dimension (P) On exit, X and Y are the solutions of the GLM problem.
WORK (workspace/output) REAL array, dimension (LWORK)
On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK (input) INTEGER
The dimension of the array WORK. LWORK >= max(1,N+M+P). For optimum performance, LWORK >= M+min(N,P)+max(N,P)*NB, where NB is an
upper bound for the optimal blocksizes for SGEQRF, SGERQF, SORMQR and SORMRQ.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this
value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFO (output) INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
LAPACK version 3.0 15 June 2000 SGGGLM(l)