EmEditor (text editor) Forum Index
   Regular Expressions
     Problem while replacing the multiple blank lines
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
prashob12
Posted on: 5/9/2008 6:23 pm
Just popping in
Joined: 4/28/2008
From:
Posts: 15
Problem while replacing the multiple blank lines
Hello:

I am having a problem while replacing multi-blank line with a single line.

I tried to add this in a macro i.e. replace \n\n with \n, here i need to run the macro multiple times that i dont want to as there are lot of files.

Is it possible to replace multiple blank lines as we do multiple spaces i.e. (\s){2,} with \1. in one go.

can i use some "character classes" presesnt in regex.

Also how should I use the character classes.
Yutaka
Posted on: 5/10/2008 8:25 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2397
Re: Problem while replacing the multiple blank lines
I wrote the macro for you:

http://www.emeditor.com/modules/newbb/viewtopic.php?topic_id=682&forum=19


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

prashob12
Posted on: 5/10/2008 10:34 am
Just popping in
Joined: 4/28/2008
From:
Posts: 15
Re: Problem while replacing the multiple blank lines
can you make this macro run on all the files in certain path where those files are present. please!!!!
Yutaka
Posted on: 5/10/2008 4:40 pm
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2397
Re: Problem while replacing the multiple blank lines
Quote:

prashob12 wrote:
can you make this macro run on all the files in certain path where those files are present. please!!!!


In that case, you can go to "Replace in Files" on the Search menu, and

Find:
(\r\n){2,}

Replace with:
\r\n

File Type:
*.txt (or enter file type)

In Folder:
File folder

Check "Use Regular Expressions"
Don't check "Keep Modified Files Open"


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

Threaded | Newest First Previous Topic | Next Topic | Top


Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文