10-16-2011
Hi birei,
Perfect! Many thanks, you have solved my problem, many thanks for your help.
Regards.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys...
I am newbie to awk and would like a solution to probably one of the simple practical questions.
I have a test file that goes as:
1,2,3,4,5,6
7,2,3,8,7,6
9,3,5,6,7,3
8,3,1,1,1,1
4,4,2,2,2,2
I would like to know how AWK can get me the distinct values say for eg: on col2... (22 Replies)
Discussion started by: anduzzi
22 Replies
2. Shell Programming and Scripting
input
COL1 a1 b1 c1 d1 e1 f1
C1 10 10 10 100 100 1000
C2 20 20 200 200 200 2000
output
C1 a1 10 1
C1 b1 10 1
C1 c1 10 1
C1 d1 100 2
C1 e1 100 2
C1 f1 1000 3
C2 ... (12 Replies)
Discussion started by: ruby_sgp
12 Replies
3. UNIX for Advanced & Expert Users
Hello,
I have a data file with 300,000 records in it, and another file which contains only the line numbers of roughly 13,000 records in the data file which have data integrity issues. I'm trying to find a way to print the original data by line number identified in the second file. How can I do... (2 Replies)
Discussion started by: peteroc
2 Replies
4. Shell Programming and Scripting
- I have two files (File 1 and File 2) and the contents of the files are mentioned below.
- I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2.
- I tried to modify and use... (10 Replies)
Discussion started by: Santoshbn
10 Replies
5. Shell Programming and Scripting
Can I print the minimum and maximum values of values in first 4 columns ?
input
3038669 3038743 3037800 3038400 m101c
3218627 3218709 3217600 3219800 m290
.............
output
3037800 3038743 m101c
3217600 3219800 m290 (2 Replies)
Discussion started by: quincyjones
2 Replies
6. Shell Programming and Scripting
Hi Experts,
I am trying to get the output from a matching pattern but unable to construct the awk command:
file :
aa bb cc 11
dd aa cc 33
cc 22 45 68
aa 33 44 44
dd aa cc 37
aa 33 44 67
I want the output to be : ( if $1 match to "aa" start of the line,then print $4 of that line, and... (3 Replies)
Discussion started by: rveri
3 Replies
7. Shell Programming and Scripting
value=$(some command)
for all in `echo $value`
do
awk checks each value (all) to see if it is a odd number. if so, prints the value
done
sounds easy enough but i've been unable to find anything on google. (2 Replies)
Discussion started by: SkySmart
2 Replies
8. Shell Programming and Scripting
Hello to all,
I'm trying to print the value corresponding to the words A, B, C, D, E. These words could appear sometimes and sometimes not inside each group of lines. Each group of lines begins with "ZYX".
My issue with current code is that should print values for 3 groups and only is... (6 Replies)
Discussion started by: Ophiuchus
6 Replies
9. Shell Programming and Scripting
can someone please help me spot and fix the issue with the following code:
awk -F, -v SEARCHPATT="(Wed|Tue)" -v ADDISTR="Mon|Tue|Wed|Thu|Fri|Sat|Sun" -vVF="$VALFOUND"
"BEGIN{ {D = D = 1
D = D = 2
}
$0 ~ "," VF "," {L = 1 ... (9 Replies)
Discussion started by: SkySmart
9 Replies
10. Shell Programming and Scripting
I use the following script to print the sum and how could I extend this to print medians instead? thanks
name s1 s2 s3 s4
g1 2 8 6 5
g1 5 7 9 9
g1 6 7 8 9
g2 8 8 8 8
g2 7 7 7 7
g2 10 10 10 10
g3 3 12 1 24
g3 5 5 24 48
g3 12 3 12 12
g3 2 3 3 3
output
name s1 s2 s3 s4
g1 5 7 8 9... (5 Replies)
Discussion started by: quincyjones
5 Replies
LEARN ABOUT REDHAT
dlaed3
DLAED3(l) ) DLAED3(l)
NAME
DLAED3 - find the roots of the secular equation, as defined by the values in D, W, and RHO, between 1 and K
SYNOPSIS
SUBROUTINE DLAED3( K, N, N1, D, Q, LDQ, RHO, DLAMDA, Q2, INDX, CTOT, W, S, INFO )
INTEGER INFO, K, LDQ, N, N1
DOUBLE PRECISION RHO
INTEGER CTOT( * ), INDX( * )
DOUBLE PRECISION D( * ), DLAMDA( * ), Q( LDQ, * ), Q2( * ), S( * ), W( * )
PURPOSE
DLAED3 finds the roots of the secular equation, as defined by the values in D, W, and RHO, between 1 and K. It makes the appropriate calls
to DLAED4 and then updates the eigenvectors by multiplying the matrix of eigenvectors of the pair of eigensystems being combined by the
matrix of eigenvectors of the K-by-K system which is solved here.
This code makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on
those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail
on hexadecimal or decimal machines without guard digits, but we know of none.
ARGUMENTS
K (input) INTEGER
The number of terms in the rational function to be solved by DLAED4. K >= 0.
N (input) INTEGER
The number of rows and columns in the Q matrix. N >= K (deflation may result in N>K).
N1 (input) INTEGER
The location of the last eigenvalue in the leading submatrix. min(1,N) <= N1 <= N/2.
D (output) DOUBLE PRECISION array, dimension (N)
D(I) contains the updated eigenvalues for 1 <= I <= K.
Q (output) DOUBLE PRECISION array, dimension (LDQ,N)
Initially the first K columns are used as workspace. On output the columns 1 to K contain the updated eigenvectors.
LDQ (input) INTEGER
The leading dimension of the array Q. LDQ >= max(1,N).
RHO (input) DOUBLE PRECISION
The value of the parameter in the rank one update equation. RHO >= 0 required.
DLAMDA (input/output) DOUBLE PRECISION array, dimension (K)
The first K elements of this array contain the old roots of the deflated updating problem. These are the poles of the secular
equation. May be changed on output by having lowest order bit set to zero on Cray X-MP, Cray Y-MP, Cray-2, or Cray C-90, as
described above.
Q2 (input) DOUBLE PRECISION array, dimension (LDQ2, N)
The first K columns of this matrix contain the non-deflated eigenvectors for the split problem.
INDX (input) INTEGER array, dimension (N)
The permutation used to arrange the columns of the deflated Q matrix into three groups (see DLAED2). The rows of the eigenvectors
found by DLAED4 must be likewise permuted before the matrix multiply can take place.
CTOT (input) INTEGER array, dimension (4)
A count of the total number of the various types of columns in Q, as described in INDX. The fourth column type is any column which
has been deflated.
W (input/output) DOUBLE PRECISION array, dimension (K)
The first K elements of this array contain the components of the deflation-adjusted updating vector. Destroyed on output.
S (workspace) DOUBLE PRECISION array, dimension (N1 + 1)*K
Will contain the eigenvectors of the repaired matrix which will be multiplied by the previously accumulated eigenvectors to update
the system.
LDS (input) INTEGER
The leading dimension of S. LDS >= max(1,K).
INFO (output) INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
> 0: if INFO = 1, an eigenvalue did not converge
FURTHER DETAILS
Based on contributions by
Jeff Rutter, Computer Science Division, University of California
at Berkeley, USA
Modified by Francoise Tisseur, University of Tennessee.
LAPACK version 3.0 15 June 2000 DLAED3(l)