Computing.Net > Forums > Programming > Copy/Rename in DOS with wildcards

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.

Copy/Rename in DOS with wildcards

Reply to Message Icon

Name: AJD10
Date: February 12, 2009 at 08:22:56 Pacific
OS: Windows XP
CPU/Ram: n/a
Product: N/a / N/A
Subcategory: Batch
Comment:

I have multiple files and need them merged into one file.
File_February_1.txt
File_February_2.txt
File_February_3.txt
File_February_4.txt

I do a "copy File*.txt FileList.txt"

I'd like to have my output file named
FileList_February.txt. How am I able to use wildcard information from the original filename into the new one?
Thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: Holla
Date: February 12, 2009 at 09:50:01 Pacific
Reply:

c:\holla>copy/?
Copies one or more files to another location.

COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/L] [/A | /B ] source [/A | /B]
     [+ source [/A | /B] [+ ...]] [destination [/A | /B]]

  source       Specifies the file or files to be copied.
  /A           Indicates an ASCII text file.
  /B           Indicates a binary file.
  /D           Allow the destination file to be created decrypted
  destination  Specifies the directory and/or filename for the new file(s).
  /V           Verifies that new files are written correctly.
  /N           Uses short filename, if available, when copying a file with a
               non-8dot3 name.
  /Y           Suppresses prompting to confirm you want to overwrite an
               existing destination file.
  /-Y          Causes prompting to confirm you want to overwrite an
               existing destination file.
  /Z           Copies networked files in restartable mode.
  /L           If the source is a symbolic link, copy the link to the target
               instead of the actual file the source link points to.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.  Default is
to prompt on overwrites unless COPY command is being executed from
within a batch script.
To append files, specify a single file for destination, but multiple files
for source (using wildcards or file1+file2+file3 format).
c:\holla>

--
Holla.


0
Reply to Message Icon

Related Posts

See More


can you help me... create a word processor



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: Copy/Rename in DOS with wildcards

Copy + Rename in DOS www.computing.net/answers/programming/copy-rename-in-dos/11196.html

Read lines from .txt file in DOS? www.computing.net/answers/programming/read-lines-from-txt-file-in-dos/15219.html

copy & rename files www.computing.net/answers/programming/copy-rename-files/20135.html