Convert HTML files from U-UNIX to DOS

Help with writing and playing macros

Convert HTML files from U-UNIX to DOS

Postby arch87506 » Fri Mar 16, 2007 10:59 pm

I am running under windows vista business edition

I have a frequently repeated operation that I want to automate. Ideally, the script would do all of the following:

1) Open all the .html files from my c:/TEMP folder (circa 20 files) - a workaround would be to drag and drop files into uedit

2) Convert all the open files to DOS files (without having to answer the nags)

3) Convert all the open files from unicode to ASCII - I see only how to do this with one click per file

4) Save all the newly converted files on top of the originals(without having to answer the nags) - close all would seem to do this, somehow I am finding that the changes are not being saved

Any help would be appreciated
User avatar
arch87506
Newbie
 
Posts: 1
Joined: Thu Mar 15, 2007 11:00 pm

Re: Convert HTML files from U-UNIX to DOS

Postby Mofi » Sat Mar 17, 2007 2:29 pm

Create a macro with following code:

Loop
IfNameIs ""
ExitLoop
EndIf
UnixMacToDos
UnicodeToASCII
CloseFile Save
EndLoop

Save this macro into a macro file. Use following on the command line for example in a shortcut:

"C:\Program Files\UltraEdit\uedit32.exe" C:\Temp\*.html /M,E="full path of macro file"

That should start UltraEdit, open all HTML files in C:\Temp\ and run the macro which converts every file from UNIX/MAC to DOS and from UNICODE to ASCII before it is saved and closed until no file is open anymore and the macro and then UE exits.

You should have never a HTML file in C:\Temp\ which is not a U-UNIX (Unicode file with Unix line terminations) when running this macro because the file content will be horrible destroyed.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4049
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Macros