[windows2000] Re: Merge files with a Script

  • From: Chris Ruggeri <chris@xxxxxxxxxx>
  • To: windows2000@xxxxxxxxxxxxx
  • Date: Mon, 30 Apr 2007 11:11:05 -0700

....maybe an easier way would be using something like below(sets a variable to name the merge file and then captures text files modifed today):
 
FOR /F "TOKENS=1,2,3,4 DELIMS=/ " %%A IN ('DATE /T') DO SET ydate=%%D%%B%%C
forfiles /p c:\TEMP /M *.txt /D 0 /c "cmd /c type @file>>c:\%YDATE%.txt"
 
my example got all txt files from c:\temp and then merged them to a file on the root of c named <todays date>.txt
 
HTH
 
Chris
 

 


-------- Original Message --------
Subject: [windows2000] Merge files with a Script
From: Dave Flaim <thethin@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, April 30, 2007 7:57 am
To: windows2000@xxxxxxxxxxxxx

I need it to be automated ... and the filenames will change by day we

would only want the ones that end in 04-30.TXT or what ever the 
current day is ... some days
their will be 2 files and some their might be 5+ files to merge.

Thanks
Dave

On Mon, 30 Apr 2007, Ray Costanzo wrote:

 > At the command prompt (or in a .cmd file) do:
 >
 > Copy
 > MTR_2007-04-30.TXT+SAL_2007-04-30.TXT+RO3_2007-04-30.TXT+MTR_2007-04-27.TXT+
 > MRO_2007-04-27.TXT 20070430.txt
 >
 > Or do you need some script that will automate this on a daily basis or
 > something?
 >
 > Ray at work
 >
 >
 > > -----Original Message-----
 > > From: windows2000-bounce@freelists.org [mailto:windows2000-
 > > bounce@freelists.org] On Behalf Of Dave Flaim
 > > Sent: Monday, April 30, 2007 9:45 AM
 > > To: windows2000@freelists.org
 > > Subject: [windows2000] Merge files with a Script
 > >
 > >
 > > I was wondering if anybody could help with their scripting expertise
 > > ...
 > >
 > > If I have a list of files in a directory ...
 > >          MTR_2007-04-30.TXT
 > >          SAL_2007-04-30.TXT
 > >          RO3_2007-04-30.TXT
 > >          MTR_2007-04-27.TXT
 > >          MRO_2007-04-27.TXT
 > >
 > > I would need to take all of the files for the given day ... let's
say
 > > ..
 > > today 04/30/2007 and merge their contents into one file named
 > > 20070430.txt
 > >


*****************************
New Site from The Kenzig Group!
Windows Vista Links, list options 
and info are available at:
http://www.VistaPop.com
***************************** 
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm
***************************** New Site from The Kenzig Group! Windows Vista Links, list options and info are available at: http://www.VistaPop.com ***************************** To Unsubscribe, set digest or vacation mode or view archives use the below link. http://thethin.net/win2000list.cfm

Other related posts: