03-20-2009
Thanks, the first solution works nicely!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
May I know, if a pipe separated File is large, what is the best method to calculate the unique row count of 3rd column and get a list of unique value of the 3rdcolum?
Thanks in advance! (20 Replies)
Discussion started by: deepakwins
20 Replies
2. Shell Programming and Scripting
I want to sort alphabetically on the first field and sort in descending numerical order on the 2nd field. With a normal "sort -r -n" it does this:
abc ||| 5e-05 ||| bla
abc ||| 3 ||| ble
def ||| 1 ||| abc
def ||| 0.2 ||| def
As you can see it ignores the fact that 5e-05 is actually 0.00005... (1 Reply)
Discussion started by: FrancoisCN
1 Replies
3. Shell Programming and Scripting
Hi Everyone,
Any simple code can simplify the code below, please advice. Thanks
# cat 2.pl
#!/usr/bin/perl
use warnings;
use strict;
my @aaaaa = <DATA>;
my @uids;
foreach (@aaaaa) {
my @ccccc = split (",", $_);
push @uids, $ccccc;... (3 Replies)
Discussion started by: jimmy_y
3 Replies
4. Shell Programming and Scripting
Hi,
I'm a learner of PERL programming.
I've a input file with the below data:
SWAT_5, 1703, 2010-09-21
SWAT_6, 2345, 2010-09-21
SWAT_7, 1792, 2010-09-21
SWAT_8, 1662, 2010-09-21
SWAT_9, 1888, 2010-09-21
VXHARP_1, 171, 2010-09-21
I need to sort this data based on the second... (6 Replies)
Discussion started by: ganapati
6 Replies
5. Shell Programming and Scripting
Input file
---------
12:name1:|host1|host1|host2|host1
13:name2:|host1|host1|host2|host3
14:name3:
......
Required output
---------------
12:name1:host1(2)|host1(1)
13:name2:host1(2)|host2(1)|host3(1)
14:name3:
where (x) - Count how many times field appears in last column
... (3 Replies)
Discussion started by: greycells
3 Replies
6. Shell Programming and Scripting
I have a file with contents below
123,502
123,506
123,702
234,101
235,104
456,104
456,100
i want to sort such that i get a unique value in column A, and for those with multiple value in A, i want the lowest value in B.
output should be
123,502
234,101
235,104
456,100 (3 Replies)
Discussion started by: dealerso
3 Replies
7. Shell Programming and Scripting
I have another file with three columns A,B,C as below
123,1,502
123,2,506
123,3,702
234,4,101
235,5,104
456,6,104
456,7,100
i want to sort such that i get a unique value in column A, and for those with multiple value in A, i want the lowest value in C.
output should be
Code:... (3 Replies)
Discussion started by: dealerso
3 Replies
8. Shell Programming and Scripting
I have this input file
tilenet_test:clar_r5_performance:server_2:4.80762:0%:APM00083103999-009E,APM00083103999-009F
tilenet_int:clar_r5_performance:server_2:4.80762:0%:APM00083103999-00C4... (3 Replies)
Discussion started by: greycells
3 Replies
9. UNIX for Dummies Questions & Answers
I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Discussion started by: cokedude
7 Replies
10. Shell Programming and Scripting
Hi,
I have an input file that I have sorted in a previous stage by $1 and $4. I now need something that will take the first record from each group of data based on the key being $1
Input file
1000AAA|"ZZZ"|"Date"|"1"|"Y"|"ABC"|""|AA
1000AAA|"ZZZ"|"Date"|"2"|"Y"|"ABC"|""|AA... (2 Replies)
Discussion started by: Ads89
2 Replies
LEARN ABOUT REDHAT
cptrfs
CPTRFS(l) ) CPTRFS(l)
NAME
CPTRFS - improve the computed solution to a system of linear equations when the coefficient matrix is Hermitian positive definite and
tridiagonal, and provides error bounds and backward error estimates for the solution
SYNOPSIS
SUBROUTINE CPTRFS( UPLO, N, NRHS, D, E, DF, EF, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO )
CHARACTER UPLO
INTEGER INFO, LDB, LDX, N, NRHS
REAL BERR( * ), D( * ), DF( * ), FERR( * ), RWORK( * )
COMPLEX B( LDB, * ), E( * ), EF( * ), WORK( * ), X( LDX, * )
PURPOSE
CPTRFS improves the computed solution to a system of linear equations when the coefficient matrix is Hermitian positive definite and tridi-
agonal, and provides error bounds and backward error estimates for the solution.
ARGUMENTS
UPLO (input) CHARACTER*1
Specifies whether the superdiagonal or the subdiagonal of the tridiagonal matrix A is stored and the form of the factorization:
= 'U': E is the superdiagonal of A, and A = U**H*D*U;
= 'L': E is the subdiagonal of A, and A = L*D*L**H. (The two forms are equivalent if A is real.)
N (input) INTEGER
The order of the matrix A. N >= 0.
NRHS (input) INTEGER
The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.
D (input) REAL array, dimension (N)
The n real diagonal elements of the tridiagonal matrix A.
E (input) COMPLEX array, dimension (N-1)
The (n-1) off-diagonal elements of the tridiagonal matrix A (see UPLO).
DF (input) REAL array, dimension (N)
The n diagonal elements of the diagonal matrix D from the factorization computed by CPTTRF.
EF (input) COMPLEX array, dimension (N-1)
The (n-1) off-diagonal elements of the unit bidiagonal factor U or L from the factorization computed by CPTTRF (see UPLO).
B (input) COMPLEX array, dimension (LDB,NRHS)
The right hand side matrix B.
LDB (input) INTEGER
The leading dimension of the array B. LDB >= max(1,N).
X (input/output) COMPLEX array, dimension (LDX,NRHS)
On entry, the solution matrix X, as computed by CPTTRS. On exit, the improved solution matrix X.
LDX (input) INTEGER
The leading dimension of the array X. LDX >= max(1,N).
FERR (output) REAL array, dimension (NRHS)
The forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution
corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by
the magnitude of the largest element in X(j).
BERR (output) REAL array, dimension (NRHS)
The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B
that makes X(j) an exact solution).
WORK (workspace) COMPLEX array, dimension (N)
RWORK (workspace) REAL array, dimension (N)
INFO (output) INTEGER
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
PARAMETERS
ITMAX is the maximum number of steps of iterative refinement.
LAPACK version 3.0 15 June 2000 CPTRFS(l)