Need help please

marvin carandang marvin_ee2006 at yahoo.com
Wed Jul 29 21:13:08 CEST 2009


Hi Kaye,

Thank you very much. I'll try this out.

Regards,




________________________________
From: Offer Kaye <offer.kaye at gmail.com>
To: General NEdit discussion list <discuss at nedit.org>
Sent: Wednesday, July 29, 2009 4:23:50 PM
Subject: Re: Need help please

On Wed, Jul 29, 2009 at 3:03 PM, marvin carandang wrote:
> Hello Nedit Experts,
>
> I have a long list of digital pattern and would like to delete certain groups of texts in between. I attached a snap-shot below. ( I just changed the content due to confidentiality reasons):
>

Since nedit's find-replace dialog can use regular expressions it is
quite powerful. If you type the following in the Find field of the
Replace dialog:

(Page\s+\d+).+\n(?n.+?)Example\s*\n

and the following in the Replace field:

\1\n


This should do the job. Of course you need to check the "Regular
Expression" checkbox before hitting the "Window" button.

To understand the above please see NEdit's regular-expressions
documentation. In any case your question is not really an "NEdit"
question, per-se, but more of a regexp-related question. For example
the following Perl one-liner, run from the Unix command-line, does the
job in nearly the same manner - or at least it should :-)

perl -pi.bak -0 -e's/(Page\s+\d+).+?Example\s*\n/$1\n/sg' <input_file>

This will replace the input_file contents and save the original in a
backup input_file.bak.

Cheers,
-- 
Offer Kaye
--
NEdit Discuss mailing list - Discuss at nedit.org
http://www.nedit.org/mailman/listinfo/discuss



      


More information about the Discuss mailing list