My target is to replace only the three first digits in IP address with new IP address
For example
NEW three first three digits – 17.100.10
OLD three first three digits - 12.200.10
Existing IP address in file - 12.200.10.2
Then I will get the new IP as 17.100.10.2
So I write the following Perl command in order to perform the replace action
But the problem is that if the NEW IP matches t
Write a regular expression (or sed script) to replace all occurrences of the letter f, followed by any number of characters, followed by the letter a, followed by one or more numeric characters, followed by the letter n, and replace whats found with the string UNIX.
hi Guys,
I have a rar file which consists of 10 files. each file has a space in its file name.
how can i replace all spaces with _
i can replace them using sed but the thing is i need to replace using a script and not command.
can anyone help me out??:confused::b:
hi Guys,
I have a rar file which consists of 10 files. each file has a space in its file name.
how can i replace all spaces with _
i can replace them using sed but the thing is i need to replace using a script and not command.
can anyone help me out??:confused:
Hi all,
I have a TAB separated file like this:
sample.rpt:
54 67 common/bin/my/home {{bla bla bla}} {bla bla} Replace Me
89 75 bad/rainy/day/out {{ some bla} } {some bla} Dontreplace Me
......
......
I wish to do a regexp match on the 3rd item, say "common/bin/my/home" and if there is a match i want to replace the 6th item &quo
My target is to replace any word/string/Any characters in file
with new word/string according to the following rules:
If numeric characters on the left side of word/string then we not replace the word
If numeric characters on the right side of word/string then we not replace the word
remark - numeric means any number or [a-z] or [A-Z]
The following Example described file before , and file a
hello, I'm trying to write the fastest sed command possible (large files will be processed) to replace RICH with NICK in a file which looks like this (below) if the occurance of RICH is uppercase, replace with uppercase if it's lowercase, replace with lowercase
SOMTHING_RICH_SOMTHING <- replace here
hellorichwhatareyoudoing <- do not replace here, forms part of a word
SOMTHING.RICH.SOMTHING
I use M-x replace-string on Emacs (M-%) quite often, and I like that I have the flexibility to choose between these options:
Spacebar Replace text and find the next occurrence
Del Leave text as is and find the next occurrence
. (period) Replace text, then stop looking for occurrences
!
I have this bash:
replace="s/AAAA/BBBB/g";
find myDirectory/. -type f -print0 | xargs -0 sed -i $replace;
that will recursively scan myDirectory tree and replace all occurrences of AAAA with BBBB on the files there.
But I want to limit this to happen on files of specific extensions, for example, .txt, .read, .po
How do I impose this limit?
thanks