Page 1 of 1

DELETE TILL and DELETYE FROM

Posted: Wed Aug 23, 2006 2:35 pm
by martib
hi!

what is the easiest way to delete all lines and signs (just everything)
from a file till a special word comes?

([[:alnum:]]+)stoprighthere did not work.


some for the rest. how do i delete everything from a word onward?
like: fromhere([[:alnum:]]+)

thanks! marti

Posted: Wed Aug 23, 2006 3:59 pm
by ben_josephs
To delete everything up to but not including stoprighthere:
Find what: .*stoprighthere
Replace with: stoprighthere

[X] Regular expression

Options
[ ] '.' does not match a newline character [i.e., not selected]
To delete everything from and including fromhere:
Find what: fromhere.*
Replace with: [nothing]
[X] Regular expression

Options
[ ] '.' does not match a newline character [i.e., not selected]

Posted: Wed Aug 23, 2006 5:28 pm
by martib
Awesome!
Quick response which works perfect

Thanks a lot.
Marti

Posted: Fri Sep 22, 2006 2:14 pm
by martib
how do i do for just deleting from the line beginning to a specific sign, like:

<start>every7847.,.thing what5449-*is here has to go<untilhere>

Posted: Fri Sep 22, 2006 3:41 pm
by ben_josephs
Please give examples of lines before and after the required deletion has been made.

Posted: Fri Sep 22, 2006 3:48 pm
by martib
now it is :
<start>every7847.,.thing what5449-*is here has to go<untilhere>

afterwards should be like this:
<start><untilhere>

Posted: Fri Sep 22, 2006 4:07 pm
by ben_josephs
Find what: <start>.*?<untilhere>
Replace with: <start><untilhere>

[X] Regular expression
Might it be time to take a look at the help?

Posted: Fri Sep 22, 2006 4:34 pm
by martib
thanks!

yeah, it really gets time to read and search more here.