Sponsored Content
Full Discussion: HELP PLs
Top Forums UNIX for Dummies Questions & Answers HELP PLs Post 302237862 by joeyg on Thursday 18th of September 2008 02:21:29 PM
Old 09-18-2008
Tools Another try with awk

I made the 4th variable easier to see/modify.
And, I did -- && $2 == "BP01" -- just so you could see that the selection and change logic [while not needed here] can be augmented and/or tested.

Code:
> awk -F"|" 'substr($1,1,3) == "087" && $2 == "BP01" {$4="PHI"} {print $1"|"$2"|"$3"|"$4"|"$5"|"$6"|"$7"|"$8"|"$9"|"}' file99 
NPANXX|BILLDATE|DIVCODE|COMID|RAO|LIKECODE|BOSS|SORD|STATECODE|
087001|BP01|H|PHI| |041|IMR6|IMSR6|AR|
087002|BP03|H|SWBT| |042|IMR6|IMSR6|AR|
087003|BP05|H|SWBT| |043|IMR6|IMSR6|AR|
087004|BP07|H|SWBT| |044|IMR6|IMSR6|AR|
087005|BP09|H|SWBT| |045|IMR6|IMSR6|AR|
087006|BP01|H|PHI| |046|IMR6|IMSR6|AR|
087007|BP03|H|SWBT| |047|IMR6|IMSR6|AR|
087008|BP05|H|SWBT| |048|IMR6|IMSR6|AR|

or, adding a couple records starting with 088...

Code:
> awk -F"|" 'substr($1,1,3) == "087" {$4="PHI"} {OFS="|"} {print}' file99 
NPANXX|BILLDATE|DIVCODE|COMID|RAO|LIKECODE|BOSS|SORD|STATECODE|TEST
087001|BP01|H|PHI| |041|IMR6|IMSR6|AR|
087002|BP03|H|PHI| |042|IMR6|IMSR6|AR|
087003|BP05|H|PHI| |043|IMR6|IMSR6|AR|
087004|BP07|H|PHI| |044|IMR6|IMSR6|AR|
087005|BP09|H|PHI| |045|IMR6|IMSR6|AR|
087006|BP01|H|PHI| |046|IMR6|IMSR6|AR|
087007|BP03|H|PHI| |047|IMR6|IMSR6|AR|
087008|BP05|H|PHI| |048|IMR6|IMSR6|AR|
088007|BP03|H|SWBT| |047|IMR6|IMSR6|AR|
088008|BP05|H|SWBT| |048|IMR6|IMSR6|AR|


Last edited by joeyg; 09-18-2008 at 03:25 PM.. Reason: added a second example
 

10 More Discussions You Might Find Interesting

1. Linux

pls help me

we hv a big enviroment networked. we use squid proxy. access allowed by src address previously. we have win2000 network with ads. my requirement is the proxy should allow domain users only for access. how can i map my windows userdatabase with squid is there any thing specific which has 2 b... (1 Reply)
Discussion started by: sriram.s
1 Replies

2. UNIX for Dummies Questions & Answers

Need help pls

Hi, I'm a newbie. I need help on my first assignment in UNIX. 1. How do I determine the number of non-empty directories? I was told to create a variable ARCHIVE, which points to the directory that contains the archive of the messages. But I'm so dumb and I don't even know how to do this. 2. In... (1 Reply)
Discussion started by: hygsg
1 Replies

3. UNIX for Dummies Questions & Answers

Pls Help

Hi every one I have got very very bad Email, My question is: How can I get all information about that f*** Email, I do mean IP,reall name, Adress, user name, password etc... I wonder if there is any program or website that I can see that email, help me please When I used windows Xp(old... (2 Replies)
Discussion started by: Cano
2 Replies

4. UNIX for Dummies Questions & Answers

Help pls!

Hi... Why should I press F1 to start windows?! I have Xp in my computer... thx 4 help Cano (1 Reply)
Discussion started by: Cano
1 Replies

5. Shell Programming and Scripting

pls help

I have a list of variables: ss1, ss5, ss6, ss8, st2 etc. (these values are not fixed, configurable). Now, I have assigned ss5=”test”. And I want to search in the list for the string “test” to know which variable is having the value “test”. Can u pls tell me how to do this? (10 Replies)
Discussion started by: kanchan_cp
10 Replies

6. Shell Programming and Scripting

pls help

Hi, I need your help guys. I have two data files, namely 101.amberized.pdb & 101.pdb . Now I want to replace the whole 3rd column of 101.amberized.pdb with the 3rd column of 101.pdb file. How do I do it in shell? Thanks in advance Parimal (11 Replies)
Discussion started by: chuchu
11 Replies

7. Shell Programming and Scripting

Pls Help

Hi Folks, I am new to this forum. and I just started learning shell scripting. I have a file called energy.out which looks like: -218213.3729 -224215.0059 -221509.3651 -221094.2627 -220660.3223 -222630.2339 -218697.8693 Now I want to calculate the average of energies and then average... (3 Replies)
Discussion started by: pkar
3 Replies

8. Shell Programming and Scripting

Pls Pls do help me

When i run this command, everything is ok. The file can be email and attached but soon after i download the file, the file cant be read. It's seem corrupted. Totally cant be read although i'm using context or wordfile. Original file generated at ek_bkup/alert/tbspace_datafile.log is OK..... ... (7 Replies)
Discussion started by: adzuanamir
7 Replies

9. Shell Programming and Scripting

Pls Help me.. soon. Very urgent

I have downloaded the Putty SSH configuration. I have entered my Host name as illinois.engr.sjsu.edu and i am trying to save that. But i am unable to save. Also i opened the session and entered my log in name But it says using keyboard interactive authentication.I am not able to get into $ ... (2 Replies)
Discussion started by: VamsiVasili
2 Replies

10. Homework & Coursework Questions

Help pls

How to find the ten most common words in a file (1 Reply)
Discussion started by: jass
1 Replies
zunbdb.f(3)							      LAPACK							       zunbdb.f(3)

NAME
zunbdb.f - SYNOPSIS
Functions/Subroutines subroutine zunbdb (TRANS, SIGNS, M, P, Q, X11, LDX11, X12, LDX12, X21, LDX21, X22, LDX22, THETA, PHI, TAUP1, TAUP2, TAUQ1, TAUQ2, WORK, LWORK, INFO) ZUNBDB Function/Subroutine Documentation subroutine zunbdb (characterTRANS, characterSIGNS, integerM, integerP, integerQ, complex*16, dimension( ldx11, * )X11, integerLDX11, complex*16, dimension( ldx12, * )X12, integerLDX12, complex*16, dimension( ldx21, * )X21, integerLDX21, complex*16, dimension( ldx22, * )X22, integerLDX22, double precision, dimension( * )THETA, double precision, dimension( * )PHI, complex*16, dimension( * )TAUP1, complex*16, dimension( * )TAUP2, complex*16, dimension( * )TAUQ1, complex*16, dimension( * )TAUQ2, complex*16, dimension( * )WORK, integerLWORK, integerINFO) ZUNBDB Purpose: ZUNBDB simultaneously bidiagonalizes the blocks of an M-by-M partitioned unitary matrix X: [ B11 | B12 0 0 ] [ X11 | X12 ] [ P1 | ] [ 0 | 0 -I 0 ] [ Q1 | ]**H X = [-----------] = [---------] [----------------] [---------] . [ X21 | X22 ] [ | P2 ] [ B21 | B22 0 0 ] [ | Q2 ] [ 0 | 0 0 I ] X11 is P-by-Q. Q must be no larger than P, M-P, or M-Q. (If this is not the case, then X must be transposed and/or permuted. This can be done in constant time using the TRANS and SIGNS options. See ZUNCSD for details.) The unitary matrices P1, P2, Q1, and Q2 are P-by-P, (M-P)-by- (M-P), Q-by-Q, and (M-Q)-by-(M-Q), respectively. They are represented implicitly by Householder vectors. B11, B12, B21, and B22 are Q-by-Q bidiagonal matrices represented implicitly by angles THETA, PHI. Parameters: TRANS TRANS is CHARACTER = 'T': X, U1, U2, V1T, and V2T are stored in row-major order; otherwise: X, U1, U2, V1T, and V2T are stored in column- major order. SIGNS SIGNS is CHARACTER = 'O': The lower-left block is made nonpositive (the "other" convention); otherwise: The upper-right block is made nonpositive (the "default" convention). M M is INTEGER The number of rows and columns in X. P P is INTEGER The number of rows in X11 and X12. 0 <= P <= M. Q Q is INTEGER The number of columns in X11 and X21. 0 <= Q <= MIN(P,M-P,M-Q). X11 X11 is COMPLEX*16 array, dimension (LDX11,Q) On entry, the top-left block of the unitary matrix to be reduced. On exit, the form depends on TRANS: If TRANS = 'N', then the columns of tril(X11) specify reflectors for P1, the rows of triu(X11,1) specify reflectors for Q1; else TRANS = 'T', and the rows of triu(X11) specify reflectors for P1, the columns of tril(X11,-1) specify reflectors for Q1. LDX11 LDX11 is INTEGER The leading dimension of X11. If TRANS = 'N', then LDX11 >= P; else LDX11 >= Q. X12 X12 is COMPLEX*16 array, dimension (LDX12,M-Q) On entry, the top-right block of the unitary matrix to be reduced. On exit, the form depends on TRANS: If TRANS = 'N', then the rows of triu(X12) specify the first P reflectors for Q2; else TRANS = 'T', and the columns of tril(X12) specify the first P reflectors for Q2. LDX12 LDX12 is INTEGER The leading dimension of X12. If TRANS = 'N', then LDX12 >= P; else LDX11 >= M-Q. X21 X21 is COMPLEX*16 array, dimension (LDX21,Q) On entry, the bottom-left block of the unitary matrix to be reduced. On exit, the form depends on TRANS: If TRANS = 'N', then the columns of tril(X21) specify reflectors for P2; else TRANS = 'T', and the rows of triu(X21) specify reflectors for P2. LDX21 LDX21 is INTEGER The leading dimension of X21. If TRANS = 'N', then LDX21 >= M-P; else LDX21 >= Q. X22 X22 is COMPLEX*16 array, dimension (LDX22,M-Q) On entry, the bottom-right block of the unitary matrix to be reduced. On exit, the form depends on TRANS: If TRANS = 'N', then the rows of triu(X22(Q+1:M-P,P+1:M-Q)) specify the last M-P-Q reflectors for Q2, else TRANS = 'T', and the columns of tril(X22(P+1:M-Q,Q+1:M-P)) specify the last M-P-Q reflectors for P2. LDX22 LDX22 is INTEGER The leading dimension of X22. If TRANS = 'N', then LDX22 >= M-P; else LDX22 >= M-Q. THETA THETA is DOUBLE PRECISION array, dimension (Q) The entries of the bidiagonal blocks B11, B12, B21, B22 can be computed from the angles THETA and PHI. See Further Details. PHI PHI is DOUBLE PRECISION array, dimension (Q-1) The entries of the bidiagonal blocks B11, B12, B21, B22 can be computed from the angles THETA and PHI. See Further Details. TAUP1 TAUP1 is COMPLEX*16 array, dimension (P) The scalar factors of the elementary reflectors that define P1. TAUP2 TAUP2 is COMPLEX*16 array, dimension (M-P) The scalar factors of the elementary reflectors that define P2. TAUQ1 TAUQ1 is COMPLEX*16 array, dimension (Q) The scalar factors of the elementary reflectors that define Q1. TAUQ2 TAUQ2 is COMPLEX*16 array, dimension (M-Q) The scalar factors of the elementary reflectors that define Q2. WORK WORK is COMPLEX*16 array, dimension (LWORK) LWORK LWORK is INTEGER The dimension of the array WORK. LWORK >= M-Q. 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 INFO is INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: November 2011 Further Details: The bidiagonal blocks B11, B12, B21, and B22 are represented implicitly by angles THETA(1), ..., THETA(Q) and PHI(1), ..., PHI(Q-1). B11 and B21 are upper bidiagonal, while B21 and B22 are lower bidiagonal. Every entry in each bidiagonal band is a product of a sine or cosine of a THETA with a sine or cosine of a PHI. See [1] or ZUNCSD for details. P1, P2, Q1, and Q2 are represented as products of elementary reflectors. See ZUNCSD for details on generating P1, P2, Q1, and Q2 using ZUNGQR and ZUNGLQ. References: [1] Brian D. Sutton. Computing the complete CS decomposition. Numer. Algorithms, 50(1):33-65, 2009. Definition at line 286 of file zunbdb.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.2 Tue Sep 25 2012 zunbdb.f(3)
All times are GMT -4. The time now is 03:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy