how to delete words between two words

February 16, 2011 at 10:25:00
Specs: Windows 7
Hi,
I want to delete all the words between say for e.g. By Viking; , By Robert;
I want to delete all the words between 'by' and ';'. regardless of middle word.

Can this be done in Notepad++ ?


See More: how to delete words between two words

Report •


#1
February 16, 2011 at 18:46:39
I am not sure what exactly you want.
If you remove the words between By and ; then only by and ; left reimaning.
is that really what you want

Subhash Chandra.


Report •

#2
February 16, 2011 at 21:08:41
One way is to use the sed utility with a regular expression. This example takes a string 'by and zero or more characters ending with a semicolon and replacing it with a string 'by', a space, and a semicolon:

# checked under solaris unix
sed 's/by.*;/by ;/g' data.txt

sed is not a normal windows utility. You can download sed for windows here:

http://gnuwin32.sourceforge.net/pac...


Report •

Related Solutions


Ask Question