blannan
asked on
MS DOS | Append a second file ext.
I have a directory with a dozen or so files that get created every day.
10001.J123
10002.J123
10003.J123
I need to keep the ".J###" for the job number but add ".DONE" to the end.
1001.J123.DONE
1002.J123.DONE
1003.J123.DONE
Any suggestions?
10001.J123
10002.J123
10003.J123
I need to keep the ".J###" for the job number but add ".DONE" to the end.
1001.J123.DONE
1002.J123.DONE
1003.J123.DONE
Any suggestions?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry I did not mention that I needed a batch command. Thanks dragon-it I am going to test this today.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I was going to do that to start with but couldn't get it to work Qlemo, i.e. along these lines:
C:\Documents and Settings\stephen\26256550> rename *.j*. *.DONE
A duplicate file name exists, or the file cannot be found.
A duplicate file name exists, or the file cannot be found.
A duplicate file name exists, or the file cannot be found.
i.e. it renames file #1 to *.DONE without the .j* bit then complains for each other one as it duplicates
C:\Documents and Settings\stephen\26256550>
A duplicate file name exists, or the file cannot be found.
A duplicate file name exists, or the file cannot be found.
A duplicate file name exists, or the file cannot be found.
i.e. it renames file #1 to *.DONE without the .j* bit then complains for each other one as it duplicates
It did work for me on XP, Vista, W7.
Sorry Qlemo, would help if I read right.... it DOES work fine like you say - if you add the exta *. I had missed out of the dest. filename too.
I confirm Qlemo's post works fine for me too! (ren *.j*. *.*.DONE)
Steve
I confirm Qlemo's post works fine for me too! (ren *.j*. *.*.DONE)
Steve
Yes, that will work, but it the "DONE"s stay in the same folder then the next time around they will get another .DONE on the end. So it depends on how the poster intends to manage these files, if they get moved out right after the rename then the Q approach works, but if they will stay in the folder afterwards while new files come in and need to be renamed then something like Steve's logic is need to skip offer the "DONE" ones.
~bp
~bp
No, they won't get renamed again. The mask *.j*. will not find those files.
Interesting, I played with this question after Steve posted looking for a way to do it all with a single REN, and could have sworn I tried that, but obviously I must have had it a bit different.
Sorry for the confusion, props to Qlemo for the simple solution.
~bp
Sorry for the confusion, props to Qlemo for the simple solution.
~bp
I have been surprised myself that it works ;-).
I think "you're just that good" Q!
:-)
:-)
http://www.bulkrenameutility.co.uk/Main_Intro.php
It can be scheduled as well with Bulk Command Line