Hi,
I have the following codes below that aims to delete every words between two pattern word. Say I have the files
To delete every word between WISH_LIST=" and " I used the below codes (but its not working):
#!/bin/sh
sed '
/WISH_LIST=\"/ {
N
/\n.*\"/ {... (3 Replies)
I've following sed command working fine -
sed '/search_pattern1/ !s/pattern1/pattern2/" file
Now, I want to search two patterns - search_pattern1 and search_pattern2 .
How can put these into above sed statement ?
Thanks in advance. (12 Replies)
Hello. There is something I can not manage : I want to swap the first word with the third one in every line. No file is given the input is read from the keyboard. I know I have to use sed, but it seems this is too complicated for me. Could you help me please ?
Thanks,
atticus (9 Replies)
Hi all,
I have a file like
one two three for
five six seven eight
.....
Actually i need to append a label to the words that belong to the 2 column and get:
one two_label three for
five six_label seven eight
....
I was trying with sed inside vim but I can't figure out... (9 Replies)
Hi,
I have to swap two consecutive line using sed in a file.
My text to swap is available in the file x.pl
#Create & map a common work library
if (!(-e "../work"))
{
system ("vlib work ../work");
system ("vmap work ../work");
}
system ("vsimsa -do thiagu_dec.do");
In this i... (6 Replies)
Hi all,
I want to make an script using sed that removes everything between 'begin' (including the line that has it) and 'end1' or 'end2', not removing this line.
Let me paste an 2 examples:
anything before
any string begin
few lines of content
end1
anything after
anything before
any... (4 Replies)
Hi,
I want to extract data b/w two words with the help of sed..
Eg: In "Anna said that she would fetch the bucket", I want to display data b/w "Anna" and "would"
O/P: said that she
I have tried with below code, but unable to get desired o/p
echo "Anna said that she would fetch the... (5 Replies)
Hi,
I think it is possible with sed, but I'm not sure...
I've a file that contains some text and filenames:
gtk-media-pause | CB60471-05 - Gilbert, Brantley - Country Must Be Country Wide.zip | 8175 | /home/floris/Muziek/Karaoke/1341838939/CB60471-05 - Gilbert, Brantley - Country Must Be... (2 Replies)
Hi guys,
I'm wondering what the best way would be to reverse words in a string based on certain characters.
For example:
echo Word1Word2Word3Word4 | sed '
/\n/ !G
s/\(Word.\)\(.*\n\)/&\2\1/
//D
'
This returns:
Word4Word3Word2Word1
I'm no sed expert but... (2 Replies)
Hi,
I have a file with certain lines in it.
i want to swap every occurance of word A with B and every occurrance of word B with A.
Example
file.txt
Unix is a great OS.
Linux support graphical user intrface.
unix and linux are both same.
Output
file.txt
Linux is a great OS.
Unix... (5 Replies)