我有一些文件(大约10 000份档案)格式简便。
SDEF-2001-23965-236.pdf
SlkF-1991-65-123.pdf
我想通过将4个特性从尾去除来核实档案名称是否以通缉格式重新命名。
SDEF-2001-23965-236.pdf >>SDEF-2001-23965.pdf
SlkF-1991-65-123.pdf >>SlkF-1991-65.pdf
我不知道我应如何建立一个能够做我需要的事情的编案。
我有一些文件(大约10 000份档案)格式简便。
SDEF-2001-23965-236.pdf
SlkF-1991-65-123.pdf
我想通过将4个特性从尾去除来核实档案名称是否以通缉格式重新命名。
SDEF-2001-23965-236.pdf >>SDEF-2001-23965.pdf
SlkF-1991-65-123.pdf >>SlkF-1991-65.pdf
我不知道我应如何建立一个能够做我需要的事情的编案。
你们需要在监督事务司中“规划”,以下联系是有用的:
rel=“nofollow” http://www.dostips.com/DtTiStringManipulation.php
如果您有*.pdf
file with Format aaaa-bbb-cc-ddd.ext
(4个部分+延长)
建立名为rn.bat
的文件:
@echo off
set str=%1
for /f "tokens=1,2,3,4 delims=- " %%a in ("%str%") do set p1=%%a&set p2=%%b&set p3=%%c&set p4=%%d
set ext=%str:~-4%
set "result=%p1%-%p2%-%p3%%ext%"
ren %1 %result%
建立名为rnall.bat
的文件:
@echo off
for %%i in (%1) do rml.bat %%i
然后进入指挥系统:rnall *.pdf
in commmand line。
This is not best code, you can use functions to do it better
I m trying to do some batch replacement for/with a fairly complex pattern So far I find the pattern as: find ( -name *.php -o -name *.html ) -exec grep -i -n hello {} + The string I want ...
I am trying to retrieve the environment variable to detect whether the system is 32 or 64 bit. But on 64 bit server the environment variable %processor_architecture% is returning x86 instead of AMD64. ...
IF %processor_architecture% == AMD64 (SET querypath=hklmsoftwarex) ELSE (SET dsetquerypath=hklmsoftwarey) FOR /F "tokens=* delims=" %%G IN ( REG QUERY "%querypath%" 2^>NUL ) DO ECHO %%G Let ...
I have a batch script that takes arguments from the command line. One of the arguments has a * in it. In spite of putting the argument in quotes, the * gets expanded before the argument gets used in ...
Suppose I have a string "AAA BBB CCC DDD EEE FFF". How can I split the string and retrieve the nth substring, in a batch file? The equivalent in C# would be "AAA BBB CCC DDD EEE FFF".Split()[n]
Binary files have a version embedded in them - easy to display in Windows Explorer. How can I retrieve that file version, from a batch file?
How can I check OS version in a batch file or through a vbs in an Windows 2k/2k3 environment ? You know ... Something like ... : "If winver Win2k then ... or if winver Win2k3 then ....
I don t know how to describe exactly what I m trying to do but here s an example batch file that demonstrates what I can t figure out.: I ve got a batch file. Inside that batch file I m trying to ...