I have a perl function in my script that needs to replace an entire line in a file
sub changestate {
my $base = ();
my @base = ();
open(BASE, $file) || die("Could not open file!");
@base=<BASE>;
close (BASE);
foreach $base(@base)
{
if($base =~... (1 Reply)
i am very new to UNIX
plz help me in this scenario
i have two text files as below
file1.txt
name=Rajakumar.
Discipline=Electronics and communication.
Designation=software Engineer.
file2.txt
name=Kannan.
Discipline=Mechanical.
Designation=CADD Design Engineer.
... (6 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,
I need to search for source path in file2 , as per file1 and if found get the next line and take the field value and put it in URL value of file1.
In file1, NF is not same for all the lines.
file1:
<type source="/home/USER/Desktop" Dest="/home/USER/DIR1/Desktop" URL="ssh/path"/>
<type... (8 Replies)
Dear all,
I have a number of files and each file has two sections separated by a blank line. At the top section, I have lines which describes the values of the alphabetical characters,
# s #; 0.123
# p #; 12.3
# d #; -2.33
# f #; 5.68
<blank line>
sssssss
spfdffff
sdfffffff
Now I... (4 Replies)
I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios.
Cat test
Nov 10, 2012 5:17:53 AM
INFO: Request Type
Line 1.... (5 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 am having text file below
System will display value URGENT and proceed
System will display value URGENT and proceed
System will display value URGENT and proceed
.................................................................. (1 Reply)
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)
Hi Everyone,
I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file.
I am very new to unix. Kindly help... (10 Replies)
Discussion started by: Pradhikshan
10 Replies
LEARN ABOUT PHP
mb_ereg_search_init
MB_EREG_SEARCH_INIT(3) 1 MB_EREG_SEARCH_INIT(3)mb_ereg_search_init - Setup string and regular expression for a multibyte regular expression matchSYNOPSIS
bool mb_ereg_search_init (string $string, [string $pattern], [string $option = "msr"])
DESCRIPTION mb_ereg_search_init(3) sets $string and $pattern for a multibyte regular expression. These values are used for mb_ereg_search(3),
mb_ereg_search_pos(3), and mb_ereg_search_regs(3).
PARAMETERS
o $string
- The search string.
o $pattern
- The search pattern.
o $option
- The search option.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
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.
SEE ALSO mb_regex_encoding(3), mb_ereg_search_regs(3).
PHP Documentation Group MB_EREG_SEARCH_INIT(3)