Delete multiple lines

General discussions about Advanced Find and Replace
Post Reply
borly
Posts: 1
Joined: Thu Oct 13, 2005 9:30 am

Delete multiple lines

Post by borly » Thu Oct 13, 2005 9:34 am

Is possible to delete multiple lines.

Example:
hello adsfas asdfas fasdf asdfsad
a sdfasd fasdf asdfdsfglklghdfgh
dfgh dfghdfghdfghdfh dghfdgh dfg

dfghfghd fgh dfg
dfgh dfgh dfg
bye

asdfasd fasd

anybody know the regular expresion to delete from hello to bye.???

Abacre
Site Admin
Posts: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Post by Abacre » Thu Oct 13, 2005 9:56 am

Hi,

Yes, it's possible.

To to main menu - Action - Batch replace and
check ON: "Modifier S". So the regular expressions will handle multiple
lines at once.

Then in main window go to Batch replace tab.
Check ON: "Use regular expressions".
Put into Search for:
hello.*bye

Replace with:
should be empty, because you delete the text.

One note:
in your case hello and bye are placed at the beginning of the lines.
In regular expressions begin of line is ^ char.

So for more reliability (for example theoretically bye maybe placed
somewhere in the middle of the text) you should use:
Search for:
^hello.*^bye

Replace with:
should be empty, because you delete the text.

Read more about syntax of r.e.:
http://www.abacre.com/afr/manual/regexpsyntax.htm
Use Regular Expression Builder (in Batch replace tab) for testing.


PS instead of using r.e. you may also use Between action of Replace
operation.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests