I'm looking to delete lines until a line with xxxxx and then keep lines of text until yyyyy. This might have to be 2 passes, but I'm a novice at textpad and do not know.
Thanks in advance.
Delete Lines Until Text & Delete Lines After Text
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
sounds like a job for a macro that includes searching
To perform a task like this, I would record a macro, which does this:
1. search for xxxxx from current cursor location, and enable the "Extend selection" option
2. deselect the xxxxx part and position cursor before the xxxxx
3. delete selected block
4. position cursor after the xxxxx
5. search for yyyyy (turn off "Extend selection" option at this point)
6. position cursor after the yyyyy
It's not clear what you want to happen after the yyyyy. Before stopping recording, position the cursor such that repeating the macro starting from step 1 will result in the desired behavior.
Since it's a macro, you can run it however many times you need to, and even save it for future use, if you want to.
Other than that, search/replace across multiple lines is very particular.. I mean, you have to know exactly how many lines are involved, in order to build an appropriate search expression.
Hope this helps. I can provide more detailed instructions if you provide more info, as Bob requested.
1. search for xxxxx from current cursor location, and enable the "Extend selection" option
2. deselect the xxxxx part and position cursor before the xxxxx
3. delete selected block
4. position cursor after the xxxxx
5. search for yyyyy (turn off "Extend selection" option at this point)
6. position cursor after the yyyyy
It's not clear what you want to happen after the yyyyy. Before stopping recording, position the cursor such that repeating the macro starting from step 1 will result in the desired behavior.
Since it's a macro, you can run it however many times you need to, and even save it for future use, if you want to.
Other than that, search/replace across multiple lines is very particular.. I mean, you have to know exactly how many lines are involved, in order to build an appropriate search expression.
Hope this helps. I can provide more detailed instructions if you provide more info, as Bob requested.
-dave
geek blog: http://spugbrap.blogspot.com
personal blog: http://spugbrap-personal.blogspot.com
family website: http://www.oatmealcookies.org
bookmarks: http://del.icio.us/spugbrap
geek blog: http://spugbrap.blogspot.com
personal blog: http://spugbrap-personal.blogspot.com
family website: http://www.oatmealcookies.org
bookmarks: http://del.icio.us/spugbrap