EmEditor (text editor) Forum Index
   Macro Samples
     Delete all blank lines in the active document
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
Yutaka
Posted on: 5/10/2008 8:25 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2424
Delete all blank lines in the active document

// Delete all blank lines in the active document  (JavaScript for EmEditor)
Redraw = false;
nLines = document.GetLines();
for( i = 1; i < nLines; i++ ){
    if( document.GetLine( i ) == "" ){
        document.selection.SetActivePoint( eePosLogical, 1, i );
        document.selection.Delete();
        i--;
        nLines--;
    }
}
Redraw = true;


----------------
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 日本語 한국어 Русский 简体中文 繁體中文