03-23-2009
Insert records in a file columnwise
Hello everyone!!!!! Need some help on inserting data in a file columnwise.
Example:
File1:
1|AAA|25|2
5|qqe|20|7
4|wer|31|81
I need to create a second file in which data can be inserted in a columnwise manner i.e.
File2:
AAA|25|1|2
qqe|20|5|7
wer|31|4|81
The order of columns in file1 and file2 need not be same as illustrated in the example. Lets say, I need to pick up column2 of file1 and it should be column1 in file2 and so on..
Could you please suggest how do I go about it?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I have one file which is having data like
10201 10202 10205 10206 10207 10208 10209 10210 10211 10213 10215
10801 10802
11406 11415 11422 11426
11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11530
11604 11608 11611
11717 11718 11719 11722 11725... (3 Replies)
Discussion started by: reldb
3 Replies
2. UNIX for Advanced & Expert Users
Hi,
I have delimited file(|).
Sample data:
1|name|50009|DS24|0|12
2|name|30009|DS24|0|13
3|name|20409|DS24|0|14
4|name|20009|DS24|0|15
5|name|10009|DS24|0|16
I want to load this data into a oracle table (update and insert)
Please help me the commands and also... (1 Reply)
Discussion started by: unihp1
1 Replies
3. Shell Programming and Scripting
Hello Everybody!!!!!!!!! Request you to help me with the below mentioned issue:
I have 2 files say,
File 1:
a|4|7
b|3|2
c|8|8
d|8|9
File 2:
a|4|6
b|2|2
c|8|8
d|9|8
The third file(output file) should have:
Data mismatch in row 1 column 3
Data mismatch in row 2 coumn 2
Data... (3 Replies)
Discussion started by: abhijeet1409
3 Replies
4. UNIX for Advanced & Expert Users
Hello everyone!!!!! Need some help on inserting data in a file columnwise.
Example:
File1:
1|AAA|25|2
5|qqe|20|7
4|wer|31|81
I need to create a second file in which data can be inserted in a columnwise manner i.e.
File2:
AAA|25|1|2
qqe|20|5|7
wer|31|4|81
The order of columns in... (1 Reply)
Discussion started by: abhijeet1409
1 Replies
5. Shell Programming and Scripting
Hi ,
I have a CSV file that has around 50K records in it. I have to delete all the duplicate rows from the file except one, depending upon data in column4.
Lets say there are 3 rows for 'column4data' in the file. I have to retain only that line which has the smallest date value in column2.... (3 Replies)
Discussion started by: Sheel
3 Replies
6. Shell Programming and Scripting
this is Korn shell unix.
The scenario is I have a pipe delimited text file which needs to be customized. say for example,I have a pipe delimited text file with 15 columns(| delimited) and 200 rows. currently the 11th and 12th column has null values for all the records(there are other null columns... (4 Replies)
Discussion started by: vasan2815
4 Replies
7. Shell Programming and Scripting
Hi All,
I want to trim each columns leading & trailing (like sql trim function) of a ',' separated file..
I've a file like this..
manab , c gi
lucky , home
babu , maa
I want the output as
manab,c gi
lucky,home
babu,maa
A one liner would be a great help. (2 Replies)
Discussion started by: manab86
2 Replies
8. Shell Programming and Scripting
Hi all,
I want to compare two files with same number of rows and columns with records in same order.
Just want to highlight the differences in the column values if any.
file A
1,kolkata,19,ab
2,delhi,89,cd
3,bangalore,56,ef
file2:
1,kolkata,21,ab
2,mumbai,89,gh
3,bangalore,11,kl... (9 Replies)
Discussion started by: prabhat.diwaker
9 Replies
9. UNIX for Dummies Questions & Answers
hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file
<sequence>
<Filename>aldorzum.doc</Filename>
<DivisionCode>US</DivisionCode>
<ContentType>Template</ContentType>
<ProductCode>VIMZIM</ProductCode>
</sequence>... (4 Replies)
Discussion started by: sravanreddy
4 Replies
10. UNIX for Beginners Questions & Answers
I have this code with me but the condition is If any of the mandatory columns are null then entire file will be rejected.
LOAD DATA
infile ' ' #specifies the name of a datafile containing data that you want to load
BADFILE ' ' #specifies the name of... (1 Reply)
Discussion started by: raka123
1 Replies
CHPGV(l) ) CHPGV(l)
NAME
CHPGV - compute all the eigenvalues and, optionally, the eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form
A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x
SYNOPSIS
SUBROUTINE CHPGV( ITYPE, JOBZ, UPLO, N, AP, BP, W, Z, LDZ, WORK, RWORK, INFO )
CHARACTER JOBZ, UPLO
INTEGER INFO, ITYPE, LDZ, N
REAL RWORK( * ), W( * )
COMPLEX AP( * ), BP( * ), WORK( * ), Z( LDZ, * )
PURPOSE
CHPGV computes all the eigenvalues and, optionally, the eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form
A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and B are assumed to be Hermitian, stored in packed format, and B is also
positive definite.
ARGUMENTS
ITYPE (input) INTEGER
Specifies the problem type to be solved:
= 1: A*x = (lambda)*B*x
= 2: A*B*x = (lambda)*x
= 3: B*A*x = (lambda)*x
JOBZ (input) CHARACTER*1
= 'N': Compute eigenvalues only;
= 'V': Compute eigenvalues and eigenvectors.
UPLO (input) CHARACTER*1
= 'U': Upper triangles of A and B are stored;
= 'L': Lower triangles of A and B are stored.
N (input) INTEGER
The order of the matrices A and B. N >= 0.
AP (input/output) COMPLEX array, dimension (N*(N+1)/2)
On entry, the upper or lower triangle of the Hermitian matrix A, packed columnwise in a linear array. The j-th column of A is
stored in the array AP as follows: if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j; if UPLO = 'L', AP(i + (j-1)*(2*n-j)/2) =
A(i,j) for j<=i<=n.
On exit, the contents of AP are destroyed.
BP (input/output) COMPLEX array, dimension (N*(N+1)/2)
On entry, the upper or lower triangle of the Hermitian matrix B, packed columnwise in a linear array. The j-th column of B is
stored in the array BP as follows: if UPLO = 'U', BP(i + (j-1)*j/2) = B(i,j) for 1<=i<=j; if UPLO = 'L', BP(i + (j-1)*(2*n-j)/2) =
B(i,j) for j<=i<=n.
On exit, the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H, in the same storage format as B.
W (output) REAL array, dimension (N)
If INFO = 0, the eigenvalues in ascending order.
Z (output) COMPLEX array, dimension (LDZ, N)
If JOBZ = 'V', then if INFO = 0, Z contains the matrix Z of eigenvectors. The eigenvectors are normalized as follows: if ITYPE = 1
or 2, Z**H*B*Z = I; if ITYPE = 3, Z**H*inv(B)*Z = I. If JOBZ = 'N', then Z is not referenced.
LDZ (input) INTEGER
The leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N).
WORK (workspace) COMPLEX array, dimension (max(1, 2*N-1))
RWORK (workspace) REAL array, dimension (max(1, 3*N-2))
INFO (output) INTEGER
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: CPPTRF or CHPEV returned an error code:
<= N: if INFO = i, CHPEV failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not convergeto zero;
> N: if INFO = N + i, for 1 <= i <= n, then the leading minor of order i of B is not positive definite. The factorization of B
could not be completed and no eigenvalues or eigenvectors were computed.
LAPACK version 3.0 15 June 2000 CHPGV(l)