02-24-2009
You had some really odd javascript links in your post which caused our software to quarantine your post.
I removed the links in this one.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi all,
the problem is like this...... i setup a file (Env.txt) which handles all the values.
NAME1=xxxxxx, where xxxxx is the value
NAME2=xxxxxx
GGGGG=uusufu
I have 6 files, where i will append the values from env.txt. These files has no specific format. all i want is to append the... (1 Reply)
Discussion started by: tungaw2004
1 Replies
2. Shell Programming and Scripting
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)
Discussion started by: Crypto
4 Replies
3. Shell Programming and Scripting
I have a script which has several occurences of statement like
command: $UCMDPATH/xyz abc
I would like to replace the entire line starting from $UCMDPATH with the ls -ltr command
eg:
Prior to change::
command: $UCMDPATH/xyz abc
After change:
command: ls -ltr
Is there a way to do... (12 Replies)
Discussion started by: jobbyjoseph
12 Replies
4. Shell Programming and Scripting
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies
5. Shell Programming and Scripting
Hi!!!
I have following xml file with 3 sections.
aaa1bbb-ccc
default
aaa1bbbdd
default
0 11 23 * *
aaa2bbb-ccc
default
aaa2bbbdd
default
0 11 23 * *
aaa3bbb-ccc
default
aaa3bbbdd
default
0 15 23 * * (15 Replies)
Discussion started by: tdev457
15 Replies
6. Shell Programming and Scripting
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)
Discussion started by: arvindng
3 Replies
7. UNIX for Dummies Questions & Answers
I am trying to search and replace using two different files with strict search rules.
One file contain some data and the other file contain some numbers as shown below.
DataFile.txt
>L1_T1
text data...
text data..
>L1_T1
text data...
text data..
>L1_T1
text data...
text data..
........ (4 Replies)
Discussion started by: Fahmida
4 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
I am editing a config file in vi that has a / on it.
At the moment, search and replace looks alright as am able to use a # as a temporary separator, i.e. :,$s#/u01/app#/u02/app#g
For doing a search, I have to escape the / do. So if I want to search for /u01/app, I am having to do... (2 Replies)
Discussion started by: newbie_01
2 Replies
9. Shell Programming and Scripting
Hi,
I need help with search and replace for the following string using vi ..
if ];then
to
if ];then
can this be done in one search and replace or need multiple ?
Thanks (3 Replies)
Discussion started by: talashil
3 Replies
10. Shell Programming and Scripting
Hi Team,
I am new to unix, please help me in this.
I have a file named properties.
The content of the file is :
##Mobile props
east.url=https://qa.east.corp.com/prop/end
west.url=https://qa.west.corp.com/prop/end
south.url=https://qa.south.corp.com/prop/end... (2 Replies)
Discussion started by: tolearn
2 Replies
LEARN ABOUT PHP
str_ireplace
STR_IREPLACE(3) 1 STR_IREPLACE(3)
str_ireplace - Case-insensitive version ofstr_replace(3).
SYNOPSIS
mixed str_ireplace (mixed $search, mixed $replace, mixed $subject, [int &$count])
DESCRIPTION
This function returns a string or an array with all occurrences of $search in $subject (ignoring case) replaced with the given $replace
value. If you don't need fancy replacing rules, you should generally use this function instead of preg_replace(3) with the i modifier.
PARAMETERS
If $search and $replace are arrays, then str_ireplace(3) takes a value from each array and uses them to search and replace on $subject. If
$replace has fewer values than $search, then an empty string is used for the rest of replacement values. If $search is an array and
$replace is a string, then this replacement string is used for every value of $search. The converse would not make sense, though.
If $search or $replace are arrays, their elements are processed first to last.
o $search
- The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.
o $replace
- The replacement value that replaces found $search values. An array may be used to designate multiple replacements.
o $subject
- The string or array being searched and replaced on, otherwise known as the haystack. If $subject is an array, then the search
and replace is performed with every entry of $subject, and the return value is an array as well.
o $count
- If passed, this will be set to the number of replacements performed.
RETURN VALUES
Returns a string or an array of replacements.
EXAMPLES
Example #1
str_ireplace(3) example
<?php
$bodytag = str_ireplace("%body%", "black", "<body text=%BODY%>");
?>
NOTES
Note
This function is binary-safe.
Caution
Replacement order gotcha
Because str_ireplace(3) replaces left to right, it might replace a previously inserted value when doing multiple replacements.
Example #2 in the str_replace(3) documentation demonstrates how this may affect you in practice.
SEE ALSO
str_replace(3), preg_replace(3), strtr(3).
PHP Documentation Group STR_IREPLACE(3)