10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a file containing the DDLs of tables in a schema. From that I need to remove all the lines from a starting string till a specific string. Here is an example.
File1.txt
-------------
CREATE TABLE "SCHEMA1"."LKP11_TBL_USERS"
( "ID" NUMBER(8,0) NOT NULL ENABLE,
"USER_ID"... (3 Replies)
Discussion started by: satyaatcgi
3 Replies
2. Shell Programming and Scripting
I need to search this "<CardinalMPI>" string and replace the same string above two lines of the string.
Nov 16, 2012 12:58:34 PM
INFO: Centinel LookUp ResponseXML : <CardinalMPI>
<ReasonCode></ReasonCode>
<ErrorDesc></ErrorDesc>
<MerchantReferenceNumber></MerchantReferenceNumber>... (4 Replies)
Discussion started by: laknar
4 Replies
3. Shell Programming and Scripting
Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ?
The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories.
So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies
4. Shell Programming and Scripting
I have a section of text in file A, see below
# falkdjf lkjadf lkjadf
lkajdf lkajdf lkajdf lkjadf
lkjadf 234.234.2.234
lkjlkjlk 234.234.3.234
#
Only the first line with "# falkdjf lkjadf lkjadf" is unique in the file. The new section that I want to overwrite the old section above is in... (1 Reply)
Discussion started by: jyang72211
1 Replies
5. Shell Programming and Scripting
hey guys,
I tried searching but most 'search and replace' questions are related to one liners.
Say I have a file to be replaced that has the following:
$ cat testing.txt
TESTING
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
ENDTESTING
This is the input file: (3 Replies)
Discussion started by: DeuceLee
3 Replies
6. Shell Programming and Scripting
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies
7. Shell Programming and Scripting
Hello everyone,
ive been trying to replace a string "kw01" in an xml file with the contents of a txt file having multiple lines. im a unix newbie and all the sed combinations i tried resulted to being garbled. Below is the contents of the txt file:
RAISEDATTIME
--------------------... (13 Replies)
Discussion started by: 4dirk1
13 Replies
8. Shell Programming and Scripting
Can someone tell me how I can do this?
e.g:
Say file1.txt contains:
today is monday
the 22 of
NOVEMBER
2010
and file2.txt contains:
the
11th
month
of
How do i replace the word NOVEMBER with (5 Replies)
Discussion started by: tuathan
5 Replies
9. Shell Programming and Scripting
i have to search a string and replace with multiple lines.
example
Input
echo 'sample text'
echo 'college days'
output
echo 'sample text'
echo 'information on students'
echo 'emp number'
echo 'holidays'
i have to search a word college and replace the multiple lines
i have... (1 Reply)
Discussion started by: unihp1
1 Replies
10. Shell Programming and Scripting
Suppose i have two files
file1.txt
Name : Raju
Address:rt8pouououoiu
City:tyretyeuetu
file2.txt
Address :28a
The line "address:28a" in file2 has to get replaced in the address line of file1 ..
The output should be
Name :Raju
Address:28a
city :tyretyeuetu
Please help me... (2 Replies)
Discussion started by: ranga27
2 Replies