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.
rename file w/part of original file
Name: IndyB Date: August 21, 2003 at 12:01:57 Pacific OS: Win2k CPU/Ram: intel 512
Comment:
Is there a way to rename a file with part of the original file name?
Original file name is ex082203.log Can I rename it to p1082203.log where the 082203 would be different for each file, and the ex would be standard for each file.
So basically I'd need to replace the ex with the p1
And this would need to be done automatically to every file in the a directory.
Name: Marooma Date: August 21, 2003 at 18:55:57 Pacific
Reply:
Try this:
REN ex??????.log p1??????.log
0
Response Number 2
Name: Adrian S Date: August 22, 2003 at 04:12:52 Pacific
Reply:
or ren ex*.* p1*.*
0
Response Number 3
Name: Brian HANLON Date: August 23, 2003 at 10:03:19 Pacific
Reply:
Have a look at: LMOD Versatile line/list modification tool to generate lists of commands, set variables to anything extracted from (DOS) output, and more.. Win NT/2000 compatible. DEC 2002
At URL: http://home.mnet-online.de/horst.muc/
This gem will enable you to take a Dir *.* /b>dlist.txt type of list, and pipe it through LMOD to produce a BATchfile which could rename with all sorts of parsing possible. It enables some very fancy dynamic creation of BATchfiles.
Summary: The DOS tools you will come to love are FIND, FC, DATE, CHOICE + standard commands. You will want to FIND /v (all except the match) to a temp file and then replace what you do want in the file. This...
Summary: Ok, here we go! The following batch script will rename the files from the current directory to their creation date and time, with the format YYMMDD-HHMM.extention (the extention will be mantained). ==...
Summary: How do I create a batch file that would rename files from a directory based on this format: 12345.67a (from original file of 2001234567-A1.txt) - the 1st 3 characters, the last character, and extensio...