Can somebody give me a cleaner way of writing the following script. I was thinking that I could use a loop in the awk statement. It works fine the way it is but I just want the script to be cleaner.
#!/usr/bin/sh
for r in 0 1 2 3 4 5 6
do
DAY=`gdate --date="${r} days ago" +%m\/%d\/%y`... (3 Replies)
I am having a problem with awk when I run it with a loop. It works perfectly when I echo a single line from the commandline. For example:
echo 'MFG009 9153852832' | awk '$2 ~ /^0-9]$/{print $2}'
The Awk command above will print field 2 if field 2 matches 10 digits, but when I run the loop... (5 Replies)
Hi guys
I having som problem trying to use sed to get a file and insert inside another one. I'll try to explain better.
I have a base.txt and using sed(having a array variables) I'm chaging some strings inside this file and saving as base1.txt. until here okay.
Then, I have to get this... (4 Replies)
I'm trying to parse a configuration text file using awk. The following is a sample from the file I'm searching. I can retrieve the formula and recipe names easily but now I want to take it one step farther. In addition to the formula name, I would like to also get the value of the attribute... (6 Replies)
Although my sed skills are gradually developing, thanks in large part to this forum, I'm having a hard time dealing with pattern space and looping, which I suspect is what I'll need a better handle on to figure out my current issue, which is converting a multi line file like this:
... (4 Replies)
I would like to loop over variables i and j consecutively,
{ a = -6.7
b = 7.0
c =0.1
{ for (i = 0; i<=(b-a)/c; i++)
for (j = 1; j<=(b-a)/c; j++)
'$1<=(a+j*c)&&$1>=(a+i*c)' FILENAME > output_j
'{print $2}' output_j > output_j_f
}
I essentially want to print the range of $1... (9 Replies)
I have the data like this:
PONUMBER,SUPPLIER,LINEITEM,SPLITLINE,LINEAMOUNT,CURRENCY
IR5555,Supplier1,1,1,83.1,USD
IR5555,Supplier1,1,3,40.4,USD
IR5555,Supplier1,1,6,54.1,USD
IR5555,Supplier1,1,8,75.1,USD
IR5556,Supplier2,1,1,41.1,USD
IR5556,Supplier2,1,3,43.1,USD
... (3 Replies)
Hi,
I've got text files (say file1 and file2) in a directory (say directory1) with several columns like this:
a b c d
a b c de f g h
e f g hI need to add a header to the files in directory1 and the names of the columns must contain an identifier from another text file (say file3) like this:... (4 Replies)
I am trying to parse a text file and send its output to another file but I am having trouble conceptualizing how I am supposed to do this in awk.
The text file has a organization like so:
Name
Date
Status
Location (city, state, zip fields)
Where each of these is on a separate line in... (1 Reply)
Discussion started by: kellyanneghj
1 Replies
LEARN ABOUT DEBIAN
sgebal.f
sgebal.f(3) LAPACK sgebal.f(3)NAME
sgebal.f -
SYNOPSIS
Functions/Subroutines
subroutine sgebal (JOB, N, A, LDA, ILO, IHI, SCALE, INFO)
SGEBAL
Function/Subroutine Documentation
subroutine sgebal (characterJOB, integerN, real, dimension( lda, * )A, integerLDA, integerILO, integerIHI, real, dimension( * )SCALE,
integerINFO)
SGEBAL
Purpose:
SGEBAL balances a general real matrix A. This involves, first,
permuting A by a similarity transformation to isolate eigenvalues
in the first 1 to ILO-1 and last IHI+1 to N elements on the
diagonal; and second, applying a diagonal similarity transformation
to rows and columns ILO to IHI to make the rows and columns as
close in norm as possible. Both steps are optional.
Balancing may reduce the 1-norm of the matrix, and improve the
accuracy of the computed eigenvalues and/or eigenvectors.
Parameters:
JOB
JOB is CHARACTER*1
Specifies the operations to be performed on A:
= 'N': none: simply set ILO = 1, IHI = N, SCALE(I) = 1.0
for i = 1,...,N;
= 'P': permute only;
= 'S': scale only;
= 'B': both permute and scale.
N
N is INTEGER
The order of the matrix A. N >= 0.
A
A is REAL array, dimension (LDA,N)
On entry, the input matrix A.
On exit, A is overwritten by the balanced matrix.
If JOB = 'N', A is not referenced.
See Further Details.
LDA
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,N).
ILO
ILO is INTEGER
IHI
IHI is INTEGER
ILO and IHI are set to integers such that on exit
A(i,j) = 0 if i > j and j = 1,...,ILO-1 or I = IHI+1,...,N.
If JOB = 'N' or 'S', ILO = 1 and IHI = N.
SCALE
SCALE is REAL array, dimension (N)
Details of the permutations and scaling factors applied to
A. If P(j) is the index of the row and column interchanged
with row and column j and D(j) is the scaling factor
applied to row and column j, then
SCALE(j) = P(j) for j = 1,...,ILO-1
= D(j) for j = ILO,...,IHI
= P(j) for j = IHI+1,...,N.
The order in which the interchanges are made is N to IHI+1,
then 1 to ILO-1.
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 permutations consist of row and column interchanges which put
the matrix in the form
( T1 X Y )
P A P = ( 0 B Z )
( 0 0 T2 )
where T1 and T2 are upper triangular matrices whose eigenvalues lie
along the diagonal. The column indices ILO and IHI mark the starting
and ending columns of the submatrix B. Balancing consists of applying
a diagonal similarity transformation inv(D) * B * D to make the
1-norms of each row of B and its corresponding column nearly equal.
The output matrix is
( T1 X*D Y )
( 0 inv(D)*B*D inv(D)*Z ).
( 0 0 T2 )
Information about the permutations P and the diagonal matrix D is
returned in the vector SCALE.
This subroutine is based on the EISPACK routine BALANC.
Modified by Tzu-Yi Chen, Computer Science Division, University of
California at Berkeley, USA
Definition at line 161 of file sgebal.f.
Author
Generated automatically by Doxygen for LAPACK from the source code.
Version 3.4.1 Sun May 26 2013 sgebal.f(3)