Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default change the file format of a text file.

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default change the file format of a text file.


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

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=54573

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default change the file format of a text file.

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.


"Leith Ross" wrote:


Hello GeneWan,

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

Name filename.log As filename.txt

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=545734


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default change the file format of a text file.

Gene,
FileCopy "c:\Source.txt", "c:\Source2.txt"

NickHK

"GeneWan" wrote in message
...
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.


"Leith Ross" wrote:


Hello GeneWan,

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

Name filename.log As filename.txt

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:

http://www.excelforum.com/member.php...o&userid=18465
View this thread:

http://www.excelforum.com/showthread...hreadid=545734




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change file format from Excel to PDF skyzone Excel Discussion (Misc queries) 1 February 23rd 06 04:12 AM
how to format a Docmd to pull in an Access file in Text format Campbellj4 Excel Programming 0 November 2nd 05 04:22 PM
how to format a Docmd to pull in an Access file in Text format Campbellj4[_2_] Excel Programming 0 November 2nd 05 04:22 PM
Open CSV file, format data and write output to a text file. BristolBloos Excel Programming 1 October 18th 05 03:50 PM
Change XLS-File Format via VB .NET Ulrich Szagun Excel Programming 2 April 8th 05 06:52 PM


All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"