06-27-2008
this can help you:
echo "" >OutputFile
for file in UrDirPath/*
do
NOL=`awk '/~Curve/,/~A/ {print}' InputFile|wc -l`
echo "$file $NOL" >>OutputFile
done
Last edited by gaurav123; 06-27-2008 at 08:26 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello. First time poster here. I have a huge file of IP numbers. I am trying to output only the class b of the IPs and rank them by most common and output the total # of duplicate class b's before the class b. An example is below:
12.107.1.1
12.107.9.54
12.108.3.89
12.109.109.4
12.109.6.3
... (2 Replies)
Discussion started by: crunchtime
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
i'd like to know if the following is possible with a shell script, and can't find the answer in the search.
Suppose i have a logfile build like this:
# 8 :riuyzp1028
# 38 : riuyzp1028
# 25 : riuyvzp1032
# 30 : nlkljpa0202
# 1 : nlklja0205
# 38 : riuyzp1028
# 25 :... (4 Replies)
Discussion started by: Freerider
4 Replies
3. Shell Programming and Scripting
Hi,
I have a sql file and i need to extract the table names used in the sql file using a unix script. If i can extract the lines between the keywords 'FROM' and 'WHERE' in the file, my job is done. can somebody tell me how to do this using a shell script. If u can just let me know, how to... (2 Replies)
Discussion started by: babloo
2 Replies
4. Shell Programming and Scripting
I have a file which contains data as below:
nbk1j7o pageName=/jsp/RMBS/RMBSHome.jsf
nbk1j7o pageName=/jsp/RMBS/RMBSHome.jsf
nbk1j7o pageName=/jsp/RMBS/RMBSHome.jsf
nbk1j7o pageName=/jsp/RMBS/RMBSHome.jsf
nbk1j7o pageName=/jsp/common/index.jsf
nbk1j7o pageName=/jsp/common/index.jsf
nbk1wqe... (6 Replies)
Discussion started by: mohsin.quazi
6 Replies
5. Shell Programming and Scripting
Hi all,
I have a positional text file that comes from some source application. Before it is processed by destination application I have to add some header (suffix) to every record(line) in the file.
e.g.
Actual File
...............
AccountDetails
AcNO Name Amount
1234 John 26578
5678... (3 Replies)
Discussion started by: sharath160
3 Replies
6. Shell Programming and Scripting
hello
im new here so i want to say hi everybody :)
i have to write a script and im newbie :/ i hope that in this forum are many ppl who knows subject :)
i have hundrets folders. in each folder is a file name trace.txt. each trace.txt has a lot of tracert's results separates with "-----" it... (6 Replies)
Discussion started by: michael8484
6 Replies
7. UNIX for Dummies Questions & Answers
Dear users,
I need to count the number of lines in a simple text file and print the number on the first line of that same file.
I know I can count the lines using
wc -l file.txt
this gives for example
100 file.txt
I need the number 100 to be printed at the very top of file.txt... (2 Replies)
Discussion started by: jenjen_mt
2 Replies
8. Shell Programming and Scripting
The question is not as simple as the title... I have a file, it looks like this
<string name="string1">RZ-LED</string>
<string name="string2">2.0</string>
<string name="string2">Version 2.0</string>
<string name="string3">BP</string>
I would like to check for duplicate entries of... (11 Replies)
Discussion started by: raidzero
11 Replies
9. Shell Programming and Scripting
I have been working on this for a little while and have been unable to come to a solution. Any help would be appreciated. I am working on a UNIX workstation and have a 30-40 meg text file that I am working with. In my real file there is hundreds of Jobs. Example of input file;
misc logging data... (1 Reply)
Discussion started by: ny_evan
1 Replies
10. Shell Programming and Scripting
I want to count lines of a file using AWK (only) and not in the END part like this awk 'END{print FNR}' because I want to use it.
Does anyone know of a way?
Thanks a lot. (7 Replies)
Discussion started by: guitarist684
7 Replies
LEARN ABOUT REDHAT
slalsd
SLALSD(l) ) SLALSD(l)
NAME
SLALSD - use the singular value decomposition of A to solve the least squares problem of finding X to minimize the Euclidean norm of each
column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-by-NRHS
SYNOPSIS
SUBROUTINE SLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND, RANK, WORK, IWORK, INFO )
CHARACTER UPLO
INTEGER INFO, LDB, N, NRHS, RANK, SMLSIZ
REAL RCOND
INTEGER IWORK( * )
REAL B( LDB, * ), D( * ), E( * ), WORK( * )
PURPOSE
SLALSD uses the singular value decomposition of A to solve the least squares problem of finding X to minimize the Euclidean norm of each
column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-by-NRHS. The solution X overwrites B. The singular values of A
smaller than RCOND times the largest singular value are treated as zero in solving the least squares problem; in this case a minimum norm
solution is returned. The actual singular values are returned in D in ascending order.
This code makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on
those binary machines without guard digits which subtract like the Cray XMP, Cray YMP, Cray C 90, or Cray 2. It could conceivably fail on
hexadecimal or decimal machines without guard digits, but we know of none.
ARGUMENTS
UPLO (input) CHARACTER*1
= 'U': D and E define an upper bidiagonal matrix.
= 'L': D and E define a lower bidiagonal matrix.
SMLSIZ (input) INTEGER The maximum size of the subproblems at the bottom of the computation tree.
N (input) INTEGER
The dimension of the bidiagonal matrix. N >= 0.
NRHS (input) INTEGER
The number of columns of B. NRHS must be at least 1.
D (input/output) REAL array, dimension (N)
On entry D contains the main diagonal of the bidiagonal matrix. On exit, if INFO = 0, D contains its singular values.
E (input) REAL array, dimension (N-1)
Contains the super-diagonal entries of the bidiagonal matrix. On exit, E has been destroyed.
B (input/output) REAL array, dimension (LDB,NRHS)
On input, B contains the right hand sides of the least squares problem. On output, B contains the solution X.
LDB (input) INTEGER
The leading dimension of B in the calling subprogram. LDB must be at least max(1,N).
RCOND (input) REAL
The singular values of A less than or equal to RCOND times the largest singular value are treated as zero in solving the least
squares problem. If RCOND is negative, machine precision is used instead. For example, if diag(S)*X=B were the least squares prob-
lem, where diag(S) is a diagonal matrix of singular values, the solution would be X(i) = B(i) / S(i) if S(i) is greater than
RCOND*max(S), and X(i) = 0 if S(i) is less than or equal to RCOND*max(S).
RANK (output) INTEGER
The number of singular values of A greater than RCOND times the largest singular value.
WORK (workspace) REAL array, dimension at least
(9*N + 2*N*SMLSIZ + 8*N*NLVL + N*NRHS + (SMLSIZ+1)**2), where NLVL = max(0, INT(log_2 (N/(SMLSIZ+1))) + 1).
IWORK (workspace) INTEGER array, dimension at least
(3*N*NLVL + 11*N)
INFO (output) INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
> 0: The algorithm failed to compute an singular value while working on the submatrix lying in rows and columns INFO/(N+1) through
MOD(INFO,N+1).
FURTHER DETAILS
Based on contributions by
Ming Gu and Ren-Cang Li, Computer Science Division, University of
California at Berkeley, USA
Osni Marques, LBNL/NERSC, USA
LAPACK version 3.0 15 June 2000 SLALSD(l)