Computing.Net > Forums > Programming > batch file to join files into one file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch file to join files into one file

Reply to Message Icon

Name: kcozart
Date: May 23, 2009 at 17:54:10 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

Hello
I am trying to make a batch file which will
do the following:
Scan for instance the F: drive and all of it
subfolders and look for a file say app.bat
and merge the contents of every find into
a single text file for viewing.
It would be good if wild cards could also be
used for instance app*.bat.
thanks
I will keep trying to figure it out



Sponsored Link
Ads by Google

Response Number 1
Name: reno
Date: May 24, 2009 at 09:29:04 Pacific
Reply:

@echo off>merge.txt

for /r /d %%a in (.) do copy/b merge.txt+"%%a\*.bat" merge.txt


0

Response Number 2
Name: kcozart
Date: May 24, 2009 at 12:28:02 Pacific
Reply:

It works great.
But could you tell me how to show above each
item found the path where found and put a
separator between each find like below.
f:\appf.bat
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

Thanks for you help
I really appreceiate it very much.
I


0

Response Number 3
Name: kcozart
Date: May 25, 2009 at 09:36:36 Pacific
Reply:

I came up with the batch file below with some help from someone else
and it does what I wanted it to do.
thanks

@echo off
if exist merge.txt del merge.txt
rem line below creates a file named merge.txt
echo. >merge.txt
for /r %%a in (app*.bat) do (
echo %%a >>merge.txt
echo $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>merge.txt
copy/b merge.txt+"%%a" merge.txt
)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch file to join files into one file

combine two files into one file www.computing.net/answers/programming/combine-two-files-into-one-file/17093.html

combine files into one file www.computing.net/answers/programming/combine-files-into-one-file/17100.html

batch file to call reg files? www.computing.net/answers/programming/batch-file-to-call-reg-files/8298.html