| 1. |
Solve : Copy files from one location to another by removing the Date in file name? |
|
Answer» I need to Copy files from one location to another by removing the Date in file name. i will give the example for what i need exactly. I need to Copy files from one location to another by removing the Date in file name. i will give the example for what i need exactly.Well you could do this two ways. We could assume that your date is always the last 8 characters before the file extension and we could write a batch file to go off of that information. We could also write a batch file based on the fact that you have an underscore before the date. So if that is the only underscore in the file name we could delimit the file name based on that commonality. Thanks for ur reply squashman .. can u give me some syntax or something ... so that i can build tat bat file... You need to tell me which example above is consistent with your data.if u give me a script with the second example.. i think i got a solution ... then clearly i not read and understand ur post right. my appoligis on that. i want to tried to help. but since i'm bad in understand ur need. better stop trying now. but before i leave if u mean batch file renamer or such here a thing to do that. and please spare me if i'm wrong again this time. http://www.freewarefiles.com/Ken-Rename_program_46337.html this software can batch rename file. all u need to do is select the folder containing ur file n u can start the task by selecting method u want to use. it have delete word function that u can set from what to waht place u want to remove. it had preveiw that will showuthe end result before u finalize it. it easy to use. once again pleae forgive me if i'm wrong this time. just trying to help.no i dont need any tool as i said ... i need a bat file ...Quote from: manis4486 on June 15, 2012, 05:46:57 AM no i dont need any tool as i said ... i need a bat file ... You can help yourself by making an attempt toward a solution and then posting it. We are excellent critics. Code: [Select]@echo off setlocal set source=c:\from set targetTo=c:\to set targetBKP=c:\bkp for /f "tokens=1-3 delims=_." %%i in ('dir /b %source%\*.csv') do ( copy "%source%\%%i_%%j.%%k" "%targetTo%\%%i.%%k" copy "%source%\%%i_%%j.%%k" "%targetBKP%\%%i.%%k" ) Methinks he just want's someone to write it for him...as opposed to learning.Quote from: patio on June 15, 2012, 06:30:44 PM Methinks he just want's someone to write it for him...as opposed to learning.That is a pretty common theme on most forums I belong to. On one forum I have seen this guy pretty much ask for help with about 2 dozen batch files over the past 6 months and has yet to help anyone with ANYTHING on the forum.@ sidewider .. thanks for your code ... its WORKING fine ... |
|