You are not logged in.
Pages: 1
hi,
i have many csv files which renamed though windows explorer. all files renamed sequentially, but how could i remove the parentheses which surrounding the files number. example of the files name tec (1), tec (2)...
Offline
Will there be parentheses anywhere besides at the end?
Offline
that is not the answer that i am looking for .
if you know any way to get out of the parentheses will be appreciated.
Offline
I'm going to give you the benefit of the doubt and assume you missed the point. Shadow Thief wasn't offering an answer, rather asking for information to determine what your requirements are prior to suggesting something.
The point being it's fairly trivial to remove all parentheses from a file name. However, if the only ones you wish to remove are the ones added at the end by Windows Explorer, it's likely to be a bit more involved.
Assuming you just want them all removed, you could do this, for example:
@echo off
cd /d X:\directory\containing\files
for %%a in (*) do (
call :rename "%%~a"
)
goto :EOF
:rename
set "name_in=%~1"
set "name_out=%name_in:(=%"
set "name_out=%name_out:)=%"
rename "%name_in%" "%name_out%"
goto :EOF
cmd | *sh | ruby | chef
Offline
Pages: 1