DOS Command/Batch File/Copy Question

Archived from groups: microsoft.public.windowsxp.help_and_support (More info?)

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.
3 answers Last reply
More about command batch file copy question
  1. Archived from groups: microsoft.public.windowsxp.help_and_support (More info?)

    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.
    >
    >
    >
    >
  2. Archived from groups: microsoft.public.windowsxp.help_and_support (More info?)

    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
  3. Archived from groups: microsoft.public.windowsxp.help_and_support (More info?)

    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.
    >>
    >>
    >>
    >>
    >
    >
Ask a new question

Read More

DOS Command Filename Windows XP