I'm trying to replace the specific numbers and use this command:
sed -e 's/[0-9]\{12\}/ /g' file.log
but nothing happens. As U can see this expression should replace all numeric occurrences with size of 12 digits, globally and replace it with space. I found out that the {, } symbols should be escaped - weird.
It doesn't work.
Please help.
I want to replace all words that contain abc , but do not contain KLM right before abc.
For example , "dasdasKLMabc" should not be changed, but "dasabc" is good to replace, I want to replace abc with rrr.
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
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:
I am trying to write a sed expression to detect lines similer to this:
s0:12345:respawn:/sbin/agetty -8 -s 115200 ttyS0 linux
and replace the "ttys0" with "something_else"
I do not want to detect commented out lines (beginning with #)
I can replace the whole line, but how to I just replace the substring, leaving the rest of the line intact ?
Hello,
I am trying to search and replace but I don't know how to do it. My simple knowlegde in search and replace using sed is not helping me at all.
File:
Code:
its a cause value #22: dfg ggg
Cause value #1: aasfa fasdf
asfa value #22: affg gggg
Basically i want to replace the colon(:) with hash (#) while retaining the rest of the words on that line.
HI ,
I can't find a solution to the following:
In a simple menu script I want to capture the input from the user with "read" and use it as a value in a variable Rempages="some_value" which is in a different script file.
So I have to perform a search and replace for this variable and only replace its value.
How can that be done?
The only part that bothers me is the Search and
I have many large Unicode files. I would like to replace each Unicode byte pair with a new Unicode byte pair. For example, the original file contains
"C3 B9 C3 AB C3 B8 C3 B0"
and I would like to replace this with
"D7 A0 D7 A8 D7 9B D7 A9".