#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Batch Files

Do you want to append all the files to gether, if so can there are no other
files in the directory, then open a dos shell window and change directory
(cd) to the folder and try:

copy *.txt totalhours.txt

that should do it.

Otherwise you can write a vba script to copy the files.


--
HTHs Martin


"nickysquawkes" wrote:


I have several a directory of text files that contain the same data but
for different weeks.

E.G.

JANHOURS.txt
FEBHOURS.txt
MARHOURS.txt
APRHOURS.txt
TOTALHOURS.txt

I want to combine all the files ending with hours into totalhours.txt
so it can be loaded into a pivot table. However I need this to be
automatic. I know it can be done using a batch file, but I can't
remeber the batch code to do this. Can anyone help?

Thanks


--
nickysquawkes
------------------------------------------------------------------------
nickysquawkes's Profile: http://www.excelforum.com/member.php...o&userid=30630
View this thread: http://www.excelforum.com/showthread...hreadid=502858


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Batch Files

I think I'd use:
copy *.txt totalhours.ALL
instead of:
copy *.txt totalhours.txt

I think that DOS will yell when it tries to copy Totalhours.txt into
totalhours.txt (since it has the same extension).

But after the copy, .all can be renamed to .txt if required.


Martin Fishlock wrote:

Do you want to append all the files to gether, if so can there are no other
files in the directory, then open a dos shell window and change directory
(cd) to the folder and try:

copy *.txt totalhours.txt

that should do it.

Otherwise you can write a vba script to copy the files.

--
HTHs Martin

"nickysquawkes" wrote:


I have several a directory of text files that contain the same data but
for different weeks.

E.G.

JANHOURS.txt
FEBHOURS.txt
MARHOURS.txt
APRHOURS.txt
TOTALHOURS.txt

I want to combine all the files ending with hours into totalhours.txt
so it can be loaded into a pivot table. However I need this to be
automatic. I know it can be done using a batch file, but I can't
remeber the batch code to do this. Can anyone help?

Thanks


--
nickysquawkes
------------------------------------------------------------------------
nickysquawkes's Profile: http://www.excelforum.com/member.php...o&userid=30630
View this thread: http://www.excelforum.com/showthread...hreadid=502858



--

Dave Peterson
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 can I batch convert 97-2003 .xls files to 2007 .xlsx files Dave Nuttall Excel Discussion (Misc queries) 4 August 3rd 09 11:38 PM
VB and Batch files JT Excel Programming 1 October 28th 05 08:07 PM
Batch conversion of XP files to 97 files AG Excel Discussion (Misc queries) 2 October 2nd 05 02:08 PM
Batch Files Mitch[_2_] Excel Programming 4 October 4th 03 04:40 PM
Batch files and VBA daver676 Excel Programming 2 September 17th 03 06:57 PM


All times are GMT +1. The time now is 04:32 PM.

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

About Us

"It's about Microsoft Excel"