DOS Command/Batch File/Copy Question

D

Dennis Marks

I have a file containing many files with a name in the format
FILENAME.txt.MMDDYY. I want to end up with a merged file of all the data.
For example, this might be 52 files containing bestsellers for each week of
the year.

Currently I am using a batch (.bat) file with:
copy *.txt.* COMBINED.txt
This works fine. (The actual batch file contains the full path name.)

What I want to do is have the merged file (COMBINED.txt) have the same name
as the input so that it will be FILENAME.txt. FILENAME can be any name but
will be the same for a single merge. I want the batch file to look at the
input first name and use it for the output first name. Is this possible? I
don't want to edit the batch file each time.
 
D

David Candy

I don't understand what you want. You can do what you want (I understood enought to tell that) but I don't get the details.
 
J

John

Dennis said:
I have a file containing many files with a name in the format
FILENAME.txt.MMDDYY. I want to end up with a merged file of all the data.
For example, this might be 52 files containing bestsellers for each week of
the year.

Currently I am using a batch (.bat) file with:
copy *.txt.* COMBINED.txt
This works fine. (The actual batch file contains the full path name.)

What I want to do is have the merged file (COMBINED.txt) have the same name
as the input so that it will be FILENAME.txt. FILENAME can be any name but
will be the same for a single merge. I want the batch file to look at the
input first name and use it for the output first name. Is this possible? I
don't want to edit the batch file each time.

Google for XP batch file commands. Variables are similar to old DOS and
what you want.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top