Jerold
Tue Apr 05 12:36:49 CDT 2005
On 5 Apr 2005 09:22:42 -0700, emebohw2@netscape.net wrote:
>Can someone post an example of how I can merge (append) a list of text
>files (all in same directory) into one big text file? This would be
>easy in unix shell scripting, but I cant figure it out with vbscript.
>If it cant be done, I would take a DOS solution if someone knows how.
>-thanks!
Using a bat file, to merge all the .txt files in c:\folder into big.txt, and delete the merged files:
@echo off
setlocal ENABLEDELAYEDEXPANSION
pushd c:\Folder
for /f "Tokens=*" %%a in ('dir /a /b /a-d *.txt') do (
if defined bigc set bigc=!bigc!+
set bigc=!bigc!"%%a"
if defined bigd set bigd=!bigd!^&
set bigd=!bigd!del /q "%%a"
)
copy %bigc% big.txt
%bigd%
popd
endlocal
Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com