Hello,
I am hoping someone can provide some guidance on using context based search and replace to search for a pattern and then do a search and replace in the line that follows it. For example, I have a file that looks like this:
<bold>bold text
</italic>
somecontent
morecontent... (3 Replies)
Hi All,
I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text.
An example of 4 lines in my file is:
1. MatchText_randomNumberOfText moreData ReplaceMe moreData
2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
hai
i am very new to unix.
i am having two files like this.
first.properties
cache.ZA.TL_CCY=SELECT trim(CCY_CODE)||trim(COUNTRY_CODE)||trim(CITY_CODE) AS... (4 Replies)
Hi All,
I have a requirement where I have to find a pattern in a file and comment the whole line containing the search pattern. Any ideas in shell is welcome.
Thanks in advance,
Regards,
Arun (3 Replies)
Hi,
I need help. I have XML file as below
<a n="infoLevel">
<v s="true"/>
</a>
<a n="localAddr">
<v s="server.host.com"/>
</a>
<a n="ListenPort">
<v s="21111"/>
</a>
I need to find variable "ListenPort" in line and then replace... (4 Replies)
There appears to be several threads that touch on what I'm trying to do, but nothing quite generic enough.
What I need to do is search through many (poorly coded) HTML files and make changes. The catch is that my search string may be on one line or may be on several lines.
For example there... (5 Replies)
Dear All,
i want to search particular string and want to replance next line value.
following is the test file.
search string is
tmp,???
,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50
tmp,123 --- if match tmp,??? then... (3 Replies)
Hi All,
i can replace a perticular value in sentence using perl.
perl -pi -e 's/old/new/' sample.txt
but i am not able to replace whole string by perl.
file1 contains "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.147.109.211)(PORT=1526))(CONNECT_DATA=(SID= MWDBD22)))". i... (3 Replies)
I have a file which requires modification via a shell script.
Need to do the following: 0. take input from user for new text. 1. search for a keyword in the file. 2. replace the line next to this to this keyword with user supplied input.
for e.g., my file has the following text:
(some... (7 Replies)
All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed...
I have an input file similar to:
&LOG
&LOG Part: "@DB/TC10000021855/--F"
&LOG
&LOG
&LOG Part: "@DB/TC10000021852/--F"
&LOG Cloning_Action: RETAIN
&LOG Part: "@DB/TCCP000010713/--A"
&LOG
&LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies
LEARN ABOUT DEBIAN
carp::datum::strip
Datum::Strip(3pm) User Contributed Perl Documentation Datum::Strip(3pm)NAME
Carp::Datum::Strip - strips most Carp::Datum calls lexically
SYNOPSIS
use Carp::Datum::Strip qw(datum_strip);
datum_strip("-", "-");
datum_strip($file, "$file.new", ".bak");
DESCRIPTION
This module exports a single routine, datum_strip(), whose purpose is to remove calls to "Carp::Datum" routines lexically.
Because stripping is done lexically, there are some restrictions about what is actually supported. Unless the conventions documented in
Carp::Datum are followed, stripping will be incorrect.
The general guidelines are:
o Do not use here documents or generalized quotes (qq) within assertion expression or tags. Write assertions using '' or "", as
appropriate.
o Assertions can be safely put on several lines, but must end with a semi-colon, outside any string.
There are two calls that will never be stripped: VERIFY() and DTRACE(). The VERIFY() is meant to be preserved (or "DREQUIRE" would have
been used). "DTRACE", when called, will be remapped dynamically to some "Log::Agent" routine, depending on the trace level. See
Carp::Datum for details.
INTERFACE
The interface of the datum_strip() routine is:
"datum_strip" old_file, new_file, [ext]
The old_file specifies the old file path, the one to be stripped. The stripped version will be written to new_file.
If the optional third argument ext is given (e.g. ".bak"), then old_file will be renamed with the supplied extension, and new_file will
be renamed old_file. Renaming only occurs if stripping was successful (i.e. the new file was correctly written to disk).
The lowest nine "rwx" mode bits from old_file are preserved when creating new_file.
Both old_file and new_file can be set to "-", in which case STDIN and STDOUT are used, respectively, and no renaming can occur, nor any
mode bit propagation.
Returns true on success, "undef" on error.
AUTHORS
Christophe Dehaudt and Raphael Manfredi are the original authors.
Send bug reports, hints, tips, suggestions to Dave Hoover at <squirrel@cpan.org>.
SEE ALSO Carp::Datum(3).
perl v5.10.0 2006-04-13 Datum::Strip(3pm)