Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4290

    reginald
    Participant

    Hi,

    first I want to say that EmEditor is a great tool.
    There is one question I want to ask.

    Is there a way to cut whole lines that contain a specified phrase and paste them to a new file?

    Let me explain a bit. For example there is a file that contains the following lines:

    test-AB-test
    test-AA-test
    test-AA1-test
    test-AC-test
    test-AA2-test
    test-AD-test

    I search for “AA” and EmEditor cut these lines and generates a new file with the lines:

    test-AA-test
    test-AA1-test
    test-AA2-test

    The original file now contains only these lines without “AA”:

    test-AB-test
    test-AC-test
    test-AD-test

    The new generated file with the “AA”-lines can be saved with a new name.

    I tried several ways with “regular expressions” or “search and replace” but I couldn´t find out how the whole lines are cut out of the original file.

    Any help available?
    Thanks a lot in advance for support.

    #4295

    Yutaka Emura
    Keymaster

    I wrote similar macros before:

    Macro that extracts lines that contain the specified string
    http://www.emeditor.com/modules/mydownloads/singlefile.php?cid=8&lid=169

    Macro that extracts lines that do not contain the specified string
    http://www.emeditor.com/modules/mydownloads/singlefile.php?cid=8&lid=170

    You can run these macros, or you can combine these macros and run once.

    #4296

    reginald
    Participant

    Thanks a lot, Yatuka, that combination of macros works… 😆

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

You must be logged in to reply to this topic.

Share with friends... Tweet about this on TwitterShare on FacebookShare on Google+Email this to someone