james123 Posted January 14, 2011 Report Share Posted January 14, 2011 Hello, I'm searching this forum for 1 hour... and could not get any post talking about this problem... but I feel it probably has been discuss already... anyway here is my problem: Rename this folder ( wich include some special characters not ascii...) 月2011月 to this: 2011 So, in other words, make a macro wich will REMOVE all chars not ASCII ( or ANSI ) from the FILENAMES or FOLDERS ... Macro express 3 ( and 4 ) return this ?2011? so I canot say replace "?" since original name include 月 and not ? Note: Using Win XP. I know macro express is limited reguarding character set... but hopully someone probably have a solution... Also, a solution may be to use an .exe COMMAND LINE UTILITY to do such work... if anyone knows about a freeware utility to solve this case ? Thank in advance for any kind repply. James ( From France, Native French speaker ) Quote Link to comment Share on other sites More sharing options...
kevin Posted January 14, 2011 Report Share Posted January 14, 2011 I do not have time right now to create a sample macro but you could try something like this: - Use a 'Repeat with folder' loop to get the name of each folder. - Create a loop to process through each character of the folder name copying only the valid ASCII letters to another variable. - Use the If Variable command to see if the variable containing the original name and the new name are different. - If different, use those variables in the Rename File or Folder command to rename the folder. Quote Link to comment Share on other sites More sharing options...
james123 Posted January 15, 2011 Author Report Share Posted January 15, 2011 I do not have time right now to create a sample macro but you could try something like this: - Use a 'Repeat with folder' loop to get the name of each folder. - Create a loop to process through each character of the folder name copying only the valid ASCII letters to another variable. - Use the If Variable command to see if the variable containing the original name and the new name are different. - If different, use those variables in the Rename File or Folder command to rename the folder. Tks for your repply. Since yesterday... I've tried many things and your suggestion but I canot make it working! The loop with picking each caracter is easy but the problem persist. As an example, if you try to assign to %T1% the value: 月 you can see it when entering it but after if you double cli to load and see contens of T1...it says: "?" ! Actually my prolem can maybe describe another way if I'm not wrong: how to turn arround the fact that ME is NOT UNICODE compatible !? I am still trying to turn arround this problem... so, if you have any solution wich works, I would be happy. Tks in advance. James PS: I have made today anoter new post ... trying other way to turn arround those special chars ...unicode... So, I'm still hardly loocking for a solution... Quote Link to comment Share on other sites More sharing options...
bilofsky Posted January 17, 2011 Report Share Posted January 17, 2011 I have had some success in a macro doing a double or triple click on a Unicode string and then pasting it into Excel. As long as the Unicode is only in the clipboard, ME can't turn it into ??s. Once in Excel perhaps a formula can be used to get the wanted ASCII version? Kind of a kludge to use Excel as part of your macro, but if you're not looking for elegance it might work. Quote Link to comment Share on other sites More sharing options...
james123 Posted January 18, 2011 Author Report Share Posted January 18, 2011 I have had some success in a macro doing a double or triple click on a Unicode string and then pasting it into Excel. As long as the Unicode is only in the clipboard, ME can't turn it into ??s. Once in Excel perhaps a formula can be used to get the wanted ASCII version? Kind of a kludge to use Excel as part of your macro, but if you're not looking for elegance it might work. Well...thank you but as you says " kind of kludge..." ... i wish to find a more elegant way... I was working a bit more arround and foud some commands working ok with unicode: UNICODE ok = COPY a LINE from FILE 1 ( UNICODE FILE ) to FILE 2 ( UNICODE FILE ) With file d:\temp.txt having the line: ?2011? <REM2:UNICODE ok = COPY a LINE from FILE 1 ( UNICODE FILE ) to FILE 2 ( UNICODE FILE )><TVAR2:04:01:d:\temp.html><TVAR2:01:04:d:\temp.txt><TMVAR2:20:01:00:000:000:%T4%F> Also working: doing a copy string <TMVAR2:09:02:01:000:000:> Also working: copy the folder NAME ( or structure ) to a file ( with a CMD dos command and the switch /U for UNICODE... <TVAR2:03:01:D:\TEST_UNICODE><TVAR2:04:01:d:\temp.txt><REM2:_____________________________________ RESET FILE T4><TVAR2:01:01:><TMVAR2:17:01:00:000:000:%T4%F><TVAR2:03:01:dir "%T3%" /AD /B /N /S >> "%T4%"><REM2:_____________________________________ COMMAND CMD avec swithc /u (UNICODE)><LAUNCHDEL2:0:01C:\WINDOWS\system32\cmd.exe<PARAM>/u /c %T3%3> Then , see also my post : http://pgmacros.invisionzone.com/index.php?showtopic=4769 wich somehow a continuation in the DOS CMD search direction... If you , or others , have more ideas... I would apreciate. Also, I was googlising a lot thos past days to fin a utility wich would STRIP (DELETE or replace ) the unicode chars in FILENAMES AND FOLDERS... But I ccould not really find anything good. The only utility ( DOS COMMAND LINE ) I was thinking it may do the job was: http://www.bulkrenameutility.co.uk/Main_Intro.php ..it supposed to replace accents (éàü...) -> eau ...but I could not do it... ( I have to admit I could understand so much this software...) if anyone knows how to use it ? Then, maybe this command line can do the UNICODE STRIP JOB ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.