Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8998
    SSI
    Member

    This seems more like something a separate utility would be used for but I thought I would ask since EmEditor is such impressive capabilities.

    Is it possible to take a single text file in EmEditor and break it into parts, and save each part as a separate text file?

    e.g. suppose I had a text file with the following contents:

    AXBCDXE

    and I wanted to split the file into three parts based on “X” so the first file would just contain “A”, the second would contain “BCD” and the third would contain “E”. Perhaps optionally the delimiter itself could be included at the beginning or end of each separate file.

    Thoughts?

    #9002
    Yutaka Emura
    Keymaster

    Hello SSI,

    Here is a JavaScript macro for this purpose:

    document.selection.SelectAll();
    var textArray = document.selection.Text.split("X");
    for( i = 0; i < textArray.length; i++ ){
    editor.NewFile();
    document.write( textArray[i] );
    }

    I hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.