DOS Command/Batch File/Copy Question



Dennis Marks
07-10-2005, 02:32 AM
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.

Dennis Marks
07-10-2005, 02:32 AM
First sentence should be "I have a folder containing many files ..."

"Dennis Marks" <denmarks@yahoo.com> wrote in message
news:uQ2fYYSeFHA.220@TK2MSFTNGP12.phx.gbl...
>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.
>
>
>
>

David Candy
07-10-2005, 02:32 AM
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.

--
--------------------------------------------------------------------------------------------------
http://webdiary.smh.com.au/archives/_comment/001075.html
=================================================
"Dennis Marks" <denmarks@yahoo.com> wrote in message news:%23ubT7ZSeFHA.2180@TK2MSFTNGP12.phx.gbl...
> First sentence should be "I have a folder containing many files ..."
>
> "Dennis Marks" <denmarks@yahoo.com> wrote in message
> news:uQ2fYYSeFHA.220@TK2MSFTNGP12.phx.gbl...
>>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.
>>
>>
>>
>>
>
>

John
07-10-2005, 02:32 AM
Dennis Marks wrote:

> 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


DOS Command/Batch File/Copy Question