change the file format of a text file.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to abstract data from a text file, but if the file extension is
".log", I need to change it to ".txt".

I can only think of doing this by first opening "ABC.log" (in the
background), upon detection of a .log extension, will use "Save As.. ABC.txt

this was what I did manually at first, but I need to speed up as there are
going to be tens of files with .log extension to be converted..

can anyone help?
 
Hello GeneWan,

You can do this more easily by using the Name statement. Once your fil
is closed use the following in your VBA code...

Name filename.log As filename.txt

Sincerely,
Leith Ros
 
Hi Leith,

Would this create a new copy or does it overwrite the original file? My
intention is to save it as a new file with the similar filename.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top