-1

I will like to do a follow up question to this question here : How to search and bookmark multiple strings at once in emeditor?

However, @Yutaka gave this response: https://i.stack.imgur.com/HLYoo.png and that is my follow up question.

How can each bookmarked strings saved differently or opened differently in emeditor when use the "extract bookmark lines to new file".

I will appreciate your response.

I am expecting the result of each bookmark strings to open in different files in em editor.

  • Check the picture.It was asked by a fellow here. and @Yutaka (the emeditor owner) replied. I only did a follow up to that question. Well the only issue is i did not quote the question link. But my request here is quite clear on what i needed. However, you do not need to rate my post negatively. That is wrong of you. – RonyKing Sourcing INC Nov 05 '22 at 13:14
  • Well the link to the original question has been included. I hope we can move on now? Thank you. – RonyKing Sourcing INC Nov 05 '22 at 16:29
  • Many thanks, But if i may ask, do you have any idea of Macro to use for this? I will really appreciate that. I will find out more on that Batch extract. Thank you. – RonyKing Sourcing INC Nov 06 '22 at 22:30

1 Answers1

0

Batch Extract

The Batch Extract button in the Batch Find dialog will output all matched lines to a file, with labels indicating the entry that the lines matched with.

Example output:

===== a =====
a
apple
===== b =====
b

Macro

This macro finds the given array of strings with the extract option, and it saves each result to separate files. Make sure to change the marked lines.

var filePath = document.FullName;
var strings = ["a", "b", "e"]; // Change these

for (var i = 0; i < strings.length; i++) {
    editor.OpenFile(filePath);
    document.selection.Find(strings[i], eeFindSelectAll | eeFindExtract, 0);
    document.Save("%HOMEPATH%\\Downloads\\" + strings[i] + ".txt"); // Change path
}

I tested it on this file. Make sure to save it before running the macro.

a
b
c
d
apple
MakotoE
  • 1,814
  • 1
  • 20
  • 39