Macro to save file as CurrentFilename+different extension

Help with writing and playing macros

Macro to save file as CurrentFilename+different extension

Postby ulicip » Fri Nov 16, 2007 11:27 pm

I have a macro that changes a pipe delimited file into a csv file with text qualifiers. This works great, but it would be nice if I could also have it save the file with a .csv extension.
So for example it save myfile.txt as myfile.csv. is this possible in ultraedit?
Thanks in advance.
User avatar
ulicip
Newbie
 
Posts: 2
Joined: Fri Nov 16, 2007 12:00 am

Re: Macro to save file as CurrentFilename+different extensio

Postby jorrasdk » Sat Nov 17, 2007 11:27 am

Add this towards the end of your macro:

CopyFilePath
Top
Paste
Key BACKSPACE
Key BACKSPACE
Key BACKSPACE
"csv"
SelectToTop
Cut
SaveAs "^c"


Caution: It expects your file has a 3 letter extension like "txt".
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: Macro to save file as CurrentFilename+different extensio

Postby ulicip » Sat Nov 17, 2007 3:52 pm

awesome... I'm glad my company uses UEdit... talk about time savings... This takes at least a minute per file to do without automation, with the macro it takes 2 seconds. I can process a whole folder full of files in less than a minute.
User avatar
ulicip
Newbie
 
Posts: 2
Joined: Fri Nov 16, 2007 12:00 am


Return to Macros