04-13-2009
Remove x,y from file then run
awk '{ for(i=1;i<=NF;i++){
printf $i " "
printf $(i+1)
i++
print ""
}
}' filename
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi ,
I want to delete some rows & columns from file.
can someone please help me on this?
Regards. (2 Replies)
Discussion started by: code19
2 Replies
2. UNIX for Dummies Questions & Answers
Dear unix gurus,
I have a data file with header information about a subject and also 3 columns of n rows of data on various items he owns. The data file looks something like this:
adam peter
blah blah blah
blah blah blah
car
01 30 200
02 31 400
03 57 121
.. .. ..
.. .. ..
n y... (8 Replies)
Discussion started by: tintin72
8 Replies
3. Shell Programming and Scripting
Hi all,
I want to read some specific rows & columns in the .xls file with my script to get the data to be manipulated. Now, I can read the .xls file correctly & i can go to the specific sheet that I want but i have a problem to specify the specific rows & columns. I mean, I want to get the info... (0 Replies)
Discussion started by: Yohannita
0 Replies
4. Shell Programming and Scripting
Hi again,
I have two files
e.g. file2
e.g. file1
BB152 6.279650E+02
AA124 6.279650E+02
AA124 6.0273E-01 9.7800E-01
AA124 6.3239E-01 9.7800E-04
AA124 6.4585E-01 7.3839E-02
BB152 6.6250E-01 2.4450E-04
BB152 7.0932E-01 1.3496E-02
CC124 7.1378E-01 2.2690E-02
CC124 7.2279E-01... (8 Replies)
Discussion started by: f_o_555
8 Replies
5. Shell Programming and Scripting
Hi Friends,
I have come across some files where some of the columns don not have data.
Key, Data1,Data2,Data3,Data4,Data5
A,5,6,,10,,
A,3,4,,3,,
B,1,,4,5,,
B,2,,3,4,,
If we see the above data on Data5 column do not have any row got filled. So remove only that column(Here Data5) and... (4 Replies)
Discussion started by: ks_reddy
4 Replies
6. Shell Programming and Scripting
Hi all, I know this sounds suspiciously like a homework course; but, it is not.
My goal is to take a file, and match my "ID" column to the "Date" column, if those conditions are true, add the total number of minutes worked and place it in this file, while not printing the original rows that I... (6 Replies)
Discussion started by: mtucker6784
6 Replies
7. Shell Programming and Scripting
echo "Month"
echo "Feb_2014"
echo "March_2014"
echo "Apr_2014"
echo "No of files"
grep ,y, Feb_2014.csv |wc -l
grep ,y, Mar_2014.csv |wc -l
grep ,y, Apr_2014.csv |wc -l
echo "Total no of success"
awk -F"," '{x+=$4}END{print x}' Feb_2014.csv
awk -F"," '{x+=$4}END{print x}'... (3 Replies)
Discussion started by: shelllearner
3 Replies
8. Shell Programming and Scripting
Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns.
I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Discussion started by: bkane3
5 Replies
9. UNIX for Dummies Questions & Answers
Hi, I am trying to selectively merge two files based on keys reported in the 1st column.
File1:
#file1-header1
file1-header2
111 qwe rtz uio
198 asd fgh jkl
165 yxc
789 poi uzt rew
89 lkj
File2:
#file2-header2
file2-header2
165 ghz nko2 ... (2 Replies)
Discussion started by: dovah
2 Replies
10. UNIX for Beginners Questions & Answers
trying to sort an array, only the 4th column is uniq,
have this:
dog cat bird house1
dog cat bird house2
dog cat bird house3
rose daisy tulip house1
rose daisy tulip house3
would like this:
dog cat bird house1 house2 house3
rose daisy tulip house1 missing house3
any help... (6 Replies)
Discussion started by: jimmyf
6 Replies
LEARN ABOUT REDHAT
sgelss
SGELSS(l) ) SGELSS(l)
NAME
SGELSS - compute the minimum norm solution to a real linear least squares problem
SYNOPSIS
SUBROUTINE SGELSS( M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK, LWORK, INFO )
INTEGER INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
REAL RCOND
REAL A( LDA, * ), B( LDB, * ), S( * ), WORK( * )
PURPOSE
SGELSS computes the minimum norm solution to a real linear least squares problem: Minimize 2-norm(| b - A*x |).
using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient.
Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS
right hand side matrix B and the N-by-NRHS solution matrix X.
The effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value.
ARGUMENTS
M (input) INTEGER
The number of rows of the matrix A. M >= 0.
N (input) INTEGER
The number of columns of the matrix A. N >= 0.
NRHS (input) INTEGER
The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
A (input/output) REAL array, dimension (LDA,N)
On entry, the M-by-N matrix A. On exit, the first min(m,n) rows of A are overwritten with its right singular vectors, stored row-
wise.
LDA (input) INTEGER
The leading dimension of the array A. LDA >= max(1,M).
B (input/output) REAL array, dimension (LDB,NRHS)
On entry, the M-by-NRHS right hand side matrix B. On exit, B is overwritten by the N-by-NRHS solution matrix X. If m >= n and
RANK = n, the residual sum-of-squares for the solution in the i-th column is given by the sum of squares of elements n+1:m in that
column.
LDB (input) INTEGER
The leading dimension of the array B. LDB >= max(1,max(M,N)).
S (output) REAL array, dimension (min(M,N))
The singular values of A in decreasing order. The condition number of A in the 2-norm = S(1)/S(min(m,n)).
RCOND (input) REAL
RCOND is used to determine the effective rank of A. Singular values S(i) <= RCOND*S(1) are treated as zero. If RCOND < 0, machine
precision is used instead.
RANK (output) INTEGER
The effective rank of A, i.e., the number of singular values which are greater than RCOND*S(1).
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 >= 1, and also: LWORK >= 3*min(M,N) + max( 2*min(M,N), max(M,N), NRHS ) For good perfor-
mance, LWORK should generally be larger.
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.
> 0: the algorithm for computing the SVD failed to converge; if INFO = i, i off-diagonal elements of an intermediate bidiagonal
form did not converge to zero.
LAPACK version 3.0 15 June 2000 SGELSS(l)