- AuthorPosts
- June 3, 2018 at 10:08 am #23300Sung-ik KoParticipant
Hello, Mr. Emura.
Can you please add a new feature – auto replacement from CJK Compatibility Ideographs to CJK Unified Ideographs?The compatibility area from U+F900..U+FAFF is still WIDELY used in Korea, but I think some Japanese people still might also use that area too.
That makes character normalization very problematic in Korea. Only some people who happen to have to deal with DB data written in old Chinese characters come to know the problem, but almost all of them have no experience in programming or text processing. So that feature can be really, really useful especially in Korea. As far as I know, no text editors seem to support auto replacement from CJK Compatibility Ideographs to CJK Unified Ideographs, And I couldn’t find any plug -in for EmEditor. (I’m using 64bit version.)
Anything will do whether plug-ins or built-in features,Sincerely.
June 3, 2018 at 10:23 am #23301Sung-ik KoParticipantp.s.
I don’t want compulsive replacement like that of chrome or mediawiki. User selection like Traditional to Simplified Chinese would be the best way for the feature.
June 3, 2018 at 12:24 pm #23302Yutaka EmuraKeymasterI am sure you should be able to do just that by writing a macro. Please write specs in details if you need me to help you writing such that macro.
June 18, 2018 at 5:20 pm #23432Sung-ik KoParticipantI tried to make a macro as you recommended, but I had a problem.
It came to a halt while dealing with just a few text files. Yes, there must be some mistakes, but I don’t know why. I am just a normal computer user and don’t know how to make a computer program, even a simple one.
Can you teach me what I didn’t do?
June 18, 2018 at 5:44 pm #23433Sung-ik KoParticipantI’m not sure if you need this one, but here’s an excel file just for your information. (if you don’t mind Korean language)
June 19, 2018 at 12:57 pm #23441Makoto EmuraKeymasterYutaka says that CJK compatibility character replacement is not planned for the near future, although he does understand that it would be useful for the Korean language.
I did revise your macro to do this, and without freezing for multiple documents, hopefully.
Your macro works fine, but I did make some changes to make it easier to maintain, if you need to modify it later on. In Uni_CJK_2.jsee, I create a list for the conversion pairs, and loop though it. Unicode characters can be written like “\u0000” if that is useful.
To fix the issue you had with the macro not able to process multiple files, Uni_CJK_3.jsee fixes this by opening one document at a time. It saves and closes the document when the script is finished with the document. I think it was a memory issue, so if that was the case, this should work.
June 19, 2018 at 5:21 pm #23444Sung-ik KoParticipantThank you for your help.
Here’s what you wrote in your macro Uni_CJK_3.jsee .
——————
var folderPath = “C:\\Users\\makot\\Downloads\\”; // Use double backslash to use backslash character in string// List of documents to process
var docs = [
[“test1.txt”],
[“test2.txt”]
];
———————-
Does it mean I have to change the folder path and the list of documents every time I work with different text file sets? If so, I’m afraid it is not very practical. Most of the time normal users open files and use ‘find & replace’ with ‘Search All Documents in the Group’ checked. Sometimes users open files from different folders. Sometimes hundreds or thousands of files from different folders. I wonder if it is too complicated a work to write a general purpose macro for that situation. if it is not a simple job, I’d better stop here.June 20, 2018 at 2:18 pm #23448Makoto EmuraKeymasterI’m not exactly sure how you want to input the list of documents. I’m afraid there is no method to get a list of documents in a folder, but what you can do in File Explorer is to highlight multiple files, hold shift, right click, and select “copy as path” to get a list of documents that you can put into the script. The scripting language is designed to be simple, so it is not able to show a graphical interface.
June 20, 2018 at 5:14 pm #23451Sung-ik KoParticipantThis is how I want to do:
1. open many files from multiple folders manually. (Sometimes the number can be hundreds, or thousands) . Once all files are open, I save them as a workplace for later use.
2. convert all CJK compatible characters in the files in the workplace to unified ones automatically by the help of a macro.
The 2nd step is what I want to do using a macro without a program halt. Is there any safe and fast way to do this using a macro?
June 21, 2018 at 11:11 am #23459Makoto EmuraKeymasterI see; then using the flag
eeFindReplaceOpenDoc
fordocument.selection.Find()
to search all open documents is the method to use, as you used, or in Uni_CJK_2.jsee. EmEditor does freeze when processing large documents, but it is working. If you have enough memory available in your system, turning off “Use Temporary File to Reduce Memory Usage” in Tools > Customize… > Advanced will decrease search time. When you start the script I recommend waiting for a couple hours, then come back to see if it finished. - AuthorPosts
- You must be logged in to reply to this topic.