Emeditor macro for combining text files?

I would like to create a .JSEE macro in Emeditor that can automatically combine multiple text files into a single text file. Emeditor has a ‘Combine Files’ wizard, but I don’t want to manually click through the menu options. I want a one-click solution.

The purpose of this macro is mux the final, combined file into a MDX. (I prefer to work with multiple small files before muxing, for example, by separating the dictionary data from the @@@LINK data, and other supplementary content.)

Previously, I used the PC version of mdict-utils, which can mux multiple TXT files into a single MDX.

But I have found that this software introduces zero-width no-break spaces into the final MDX, resulting in some headwords not being searchable.

concatenating files? i think it can be done through “cat” in most unix environments, but in the code itself it also can be implemented quite easily, since it’s python.
as for the spaces, you can use a “trim” function

i bet they are going to accept your PR if you’re willing to work on it

ok. I used Windows cmd
copy /b a.txt + b.txt + c.txt FINAL.txt
to merge the text files. didn’t have to go through emeditor.


anyway, I finally found the root of the problem: one of the text files I merged was incorrectly saved as 'UTF-8 with Signature". I changed to ‘without Signature’ and the MDX was properly built with no errors to the index.

So, this was a user error, instead of a problem with the PC version of mdict-utils.

1 Like

windows uses utf16 by default