Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: text split? #7145
    Pancho
    Member

    [deleted]

    in reply to: text split? #7144
    Pancho
    Member

    topic7 wrote:
    i have one 5000 line text file.
    i want to make 50 files that has 100lines.
    what will i do?

    try this: (change ‘ Number of lines for each ‘ to 100)

    if( !editor.EnableTab ){
    editor.EnableTab = true;
    alert( “Please run this macro again.” );
    Quit();
    }

    sPath = document.FullName; // Set the root folder where you want to save the split files. It must already exist.
    // The result files will be save as “1.txt”, “2.txt”, “3.txt”, … in this folder.
    // If the same file names already exist, these files will be overwritten!
    i = 1;
    Redraw = false;
    while( 1 ) {
    docSearch = editor.ActiveDocument;
    editor.NewFile();
    docResult = editor.ActiveDocument;
    docSearch.Activate();
    docSearch.selection.StartOfDocument();
    docSearch.selection.LineDown( true, 100000 ); // Number of lines for each split file to contain
    sLine = docSearch.selection.Text;
    if( sLine == “” ){
    docResult.Close();
    break;
    }
    docSearch.selection.Delete(1);
    docResult.Activate();
    docResult.selection.Text = sLine;
    docResult.Save( sPath + ‘_’+i + “.txt” );
    i++;
    docResult.Close();
    docSearch.Activate();
    }
    Redraw = true;
    powered by Yutaka

    in reply to: regexp: Replace in multiple-line text #7019
    Pancho
    Member

    sorry,
    “Additional Lines to Search for Regular Expressions text box” was 0
    i did 50 and works fine !

    in reply to: Search and Highlight function in open document #6904
    Pancho
    Member

    This really work :-) ehaaaaa
    str = ‘functions+’+document.selection.Text;
    document.selection.Find(str,eeFindNext | eeFindAround | eeFindReplaceRegExp);

    Thanks for advises !!

    in reply to: Search and Highlight function in open document #6903
    Pancho
    Member

    not quite so … please see image:

    in reply to: Search and Highlight function in open document #6899
    Pancho
    Member

    You should be able to do this by using the Find method (of the Selection object) with eeFindReplaceOpenDoc parameter to search all open documents.

    I do not want search to all open documents, only active(current document)

    How to get all text document in Selection object ?

    document.selection.SelectAll();
    str = document.selection.text;

    right ? As without the allocation of the entire text (like Ctrl+A) ?

Viewing 6 posts - 1 through 6 (of 6 total)