04-30-2009
find a string in a file and add some text after that file
Hi
Could you please help me out by solving teh below problem ?
I have a file with as below
source1|target1|yes
source2|target2|no
source1 is file in which i have to place some code under the <head> tag in it.
What code i have to place in source1 is something like this "abcd.....<target1> ...xyz"
But i have to do this replacment only is the third string in the above file "source1|target1|yes" is "yes"
if is no, i shouldn't replace the code.
Could anyone help to resolve this problem ?
Thanks in Advance,
Tasha
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to search through all files with different file suffixes in a directory structure to locate any files containing a specific string (5 Replies)
Discussion started by: wrwelden
5 Replies
2. Shell Programming and Scripting
Hello!
Please, help me to write such script.
I have some text file with name filename.txt
I must check if this file contains string "test-string-first", I must cut from this file string which follows string "keyword-string:" and till first white-space and save it to some variable.
For... (3 Replies)
Discussion started by: optik77
3 Replies
3. Shell Programming and Scripting
Hi,
So I'm kinda new to shell scripts and the like. I've picked up quite a bit of use from browsing the forums here but ran into a new one that I can't seem to find an answer for.
I'm looking to parse/find a string AND the next 15 or so charachters that follow the string within a text file... (1 Reply)
Discussion started by: kar23me
1 Replies
4. Shell Programming and Scripting
I have a text file where I need to find the string = ST*850*
This string is repetaed several times in the file, so I need to know how many times it appears in the file, this is the text files:
ISA*00* *00* *08*925485USNR *ZZ*IMSALADDERSP... (13 Replies)
Discussion started by: cucosss
13 Replies
5. Shell Programming and Scripting
Hi ,
I have a simple text file with contents as below:
12345678900 971,76 4234560890
22345678900 5971,72 5234560990
32345678900 71,12 6234560190
the new csv-file should be like:
Column1;Column2;Column3;Column4;Column5
123456;78900;971,76;423456;0890... (9 Replies)
Discussion started by: FreddyDaKing
9 Replies
6. Shell Programming and Scripting
I am having a text file which is having more than 200 lines.
EX:
001010122 12000 BIB 12000 11200 1200003
001010122 2000 AND 12000 11200 1200003
001010122 12000 KVB 12000 11200 1200003
In the above file i want to search for string KVB and add/replace... (1 Reply)
Discussion started by: suryanarayana
1 Replies
7. Shell Programming and Scripting
Dear All
I am having a text file which is having more than 200 lines.
EX:
001010122 12000 BIB 12000 11200 1200003
001010122 2000 AND 12000 11200 1200003
001010122 12000 KVB 12000 11200 1200003
In the above file i want to search for string KVB... (5 Replies)
Discussion started by: suryanarayana
5 Replies
8. Shell Programming and Scripting
I have two files
1. input.txt
2. keyword.txt
input.txt has contents like
.src_ref 0 "call.s" 24 first
0x000000 0x5a80 0x0060 BRA.l 0x60
.src_ref 0 "call.s" 30 first
0x000002 0x1bc5 RETI
.src_ref 0 "call.s" 31 first
0x000003 0x6840 ... (2 Replies)
Discussion started by: acdc
2 Replies
9. Shell Programming and Scripting
Hi guys,
I have a text file named file1.txt that is formatted like this:
001 , ID , 20000
002 , Name , Brandon
003 , Phone_Number , 616-234-1999
004 , SSNumber , 234-23-234
005 , Model , Toyota
007 , Engine ,V8
008 , GPS , OFF
and I have file2.txt formatted like this:
... (2 Replies)
Discussion started by: An0mander
2 Replies
10. UNIX for Beginners Questions & Answers
Dear all,
I want to find all the "," in my text file and then replace the commas to a tab. I found a script online but I don't know how to modify the script for my case. Any one can help? Thank you.
@echo off &setlocal
set "search=%1"
set "replace=%2"
set "textfile=Input.txt"
set... (2 Replies)
Discussion started by: forevertl
2 Replies
LEARN ABOUT CENTOS
slalsd
slalsd.f(3) LAPACK slalsd.f(3)
NAME
slalsd.f -
SYNOPSIS
Functions/Subroutines
subroutine slalsd (UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND, RANK, WORK, IWORK, INFO)
SLALSD uses the singular value decomposition of A to solve the least squares problem.
Function/Subroutine Documentation
subroutine slalsd (characterUPLO, integerSMLSIZ, integerN, integerNRHS, real, dimension( * )D, real, dimension( * )E, real, dimension( ldb, *
)B, integerLDB, realRCOND, integerRANK, real, dimension( * )WORK, integer, dimension( * )IWORK, integerINFO)
SLALSD uses the singular value decomposition of A to solve the least squares problem.
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.
Parameters:
UPLO
UPLO is CHARACTER*1
= 'U': D and E define an upper bidiagonal matrix.
= 'L': D and E define a lower bidiagonal matrix.
SMLSIZ
SMLSIZ is INTEGER
The maximum size of the subproblems at the bottom of the
computation tree.
N
N is INTEGER
The dimension of the bidiagonal matrix. N >= 0.
NRHS
NRHS is INTEGER
The number of columns of B. NRHS must be at least 1.
D
D is 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
E is REAL array, dimension (N-1)
Contains the super-diagonal entries of the bidiagonal matrix.
On exit, E has been destroyed.
B
B is 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
LDB is INTEGER
The leading dimension of B in the calling subprogram.
LDB must be at least max(1,N).
RCOND
RCOND is 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 problem,
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
RANK is INTEGER
The number of singular values of A greater than RCOND times
the largest singular value.
WORK
WORK is 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
IWORK is INTEGER array, dimension at least
(3*N*NLVL + 11*N)
INFO
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
> 0: The algorithm failed to compute a singular value while
working on the submatrix lying in rows and columns
INFO/(N+1) through MOD(INFO,N+1).
Author:
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date:
September 2012
Contributors:
Ming Gu and Ren-Cang Li, Computer Science Division, University of California at Berkeley, USA
Osni Marques, LBNL/NERSC, USA
Definition at line 179 of file slalsd.f.
Author
Generated automatically by Doxygen for LAPACK from the source code.
Version 3.4.2 Tue Sep 25 2012 slalsd.f(3)