Viewing 3 posts - 1 through 3 (of 3 total)
- AuthorPosts
- October 11, 2022 at 6:03 am #28695DavidParticipant
I have thousands of text files with ANSI encode and want to convert to GB 2312 in batch. Now, we have to open all of them via “File-> Save All with Encoding”.
My question is : how to convert encode of these files without openning files, such as using command line.
I have tried “Emeditor.exe “C:\Users\elan\Desktop\*.txt” /cp 65001 /cps 936 ” but it doesn’t work. Does anyone have suggestions? Thanks!October 12, 2022 at 9:06 am #28722Yutaka EmuraKeymasterYou can write a macro to save a file as GB2312 (my sample as below), and then use the Advanced Open on the File menu or the Run with Temporary Options on the Macros menu to specify all the files to convert.
document.Encoding = 936; // Chinese Simplified (gb2312) s = document.FullName; nExt = s.lastIndexOf( "." ); nBackslash = s.lastIndexOf( "\\" ); if( nExt == -1 || nExt < nBackslash ) { nExt = s.length; } s = s.substr( 0, nExt ) + "-gb2312" + s.substr( nExt ); document.Save( s );
October 12, 2022 at 6:22 pm #28737DavidParticipantThank you for your information.I will try and feedback.
- AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.