Let me be clear once again as per below code, i am getting ctry_input as input to my shell program. Where in if i get countries like nz,usa,uk then source should be replaced as diff
Apart from nz,usa,uk it should be
any_other_country if eg if i pass as aus then it would source_table_aus_final
Hi all.
I have the following command that is successfully searching for any one of the strings on all lines of a file and replacing it with the instructed value.
cat inputFile | awk '{gsub(/aaa|bbb|ccc|ddd/,"1234")}1' > outputFile
This does in fact replace any occurrence of aaa, bbb,... (2 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Hi,
I want to achieve something similar to what described in another post:
The difference is I want to add the line if the pattern is not found.
File 1:
A123, valueA, valueB
B234, valueA, valueB
C345, valueA, valueB
D456, valueA, valueB
E567, valueA, valueB
F678, valueA, valueB
... (11 Replies)
I have a file1 with different with multiple fields and records
File2 has 2 fields.
I want to find and replace strings in file1 based on file2 values (I Want an exact match i.e. for example: when searching for DT:3, Substr of DT:34 should not be matched)
File2:
DT:3 foo_err
DT:34 bar_frr... (8 Replies)
Hello everyone,
I am comparing two floating point numbers by storing them in seperate files and then using difference command to verify,it is working fine.
But I want to compare two values which will come at 4 precision places.
ex:
file1
Date,Count,Checksum... (7 Replies)
Hi,
I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Hi I need help with writing a script to change a string in a file.
The script needs to read an input list (list.txt) file line by line searching for that string in a text.file. Once the string is found the last few words in the string should be replaced.
eg list.txt will contain
hello my... (6 Replies)
Hi
I have a large txt file on my AIX server and I need to replace some text using two other files. So filename1 has about 500 lines similar to:
txtcode SYStem100
I have the string I want to change in string2 and the new stringname in string3. Does anyone know a way of doing this? I have... (1 Reply)
Hi,
I did some research but cannot find the right solution so hopefully someone can help me here.
I have a long string format like:
VAR=111:aaaa,222:bbb,333:ccc
it could be
VAR=111:aaa,222:bbb,333:ccc,444:ddd, etc
what I looking for is eg.
if I give ccc, it will return me 333... (2 Replies)
Hi Folks -
Linux Version = Linux 2.6.39-400.128.17.el5uek x86_64
I have a process that determines the start and end load periods for an Oracle data load process.
The variables used are as follows follows:
They are populated like such:
However, the load requires the month to be the... (11 Replies)
Discussion started by: SIMMS7400
11 Replies
LEARN ABOUT PHP
mb_eregi_replace
MB_EREGI_REPLACE(3) 1 MB_EREGI_REPLACE(3)mb_eregi_replace - Replace regular expression with multibyte support ignoring caseSYNOPSIS
string mb_eregi_replace (string $pattern, string $replace, string $string, [string $option = "msri"])
DESCRIPTION
Scans $string for matches to $pattern, then replaces the matched text with $replacement.
PARAMETERS
o $pattern
- The regular expression pattern. Multibyte characters may be used. The case will be ignored.
o $replace
- The replacement text.
o $string
- The searched string.
o $option
-$option has the same meaning as in mb_ereg_replace(3).
RETURN VALUES
The resultant string or FALSE on error.
NOTES
Note
The internal encoding or the character encoding specified by mb_regex_encoding(3) will be used as the character encoding for this
function.
Warning
Never use the e modifier when working on untrusted input. No automatic escaping will happen (as known from preg_replace(3)). Not
taking care of this will most likely create remote code execution vulnerabilities in your application.
SEE ALSO mb_regex_encoding(3), mb_ereg_replace(3).
PHP Documentation Group MB_EREGI_REPLACE(3)