BAT- Any truncated transform character

xiaoxiao2021-03-06  78

FOR / F ["Options"]% variable in (file-set) do command [command-parameters] for / f ["Options"]% variable in ("string") do common [command-parameters] for / f [ "Options"]% variable in ('command') do command [command-parameters]

Optinoseol = C - Refers to the end of a row bet release character (one) // To ignore rows SKIP = N - refer to the number of rows ignored at the beginning of the file. Delims = xxx - Indicator jacket set. This // specified segmentation of this replaced space and the jumper is included in Delims =;:. Use ";", ":", "." To separate the default separator set. Tokens = x, y, m-n - means which symbols per row are passed to each iteration for itself. This can cause allocation of the additional variable name. M-N format is a range. Specify MTH via NTH symbol. If the last character in the symbol string is asterisk, then additional variables will be allocated and accepted after the last symbol parsing. Usebackq - Specify new grammar has been used under the case: Perform a back quotation string as a command and a single quotation number character is a text string command and allows double quotes to expand file names in FileNameSet. List FOR / F "tokens = 1-3 delims = :."% 1 in ("% time%") Do @echo% 1-% 2-% 3 Tripart% Time% return characters and replace for / f "tokens = 2 delims = "% 1 in ("% date%) Do @echo% 1 Truncate% DATE% returned characters

The format specified by% DATE% % Time% 2004-10-12 @ 12-11 is the year - month - day @ 小 - 分 月 "" tokens = 2 delims = "% 1 in ("% Date % ") Do @set D =% 1FOR / F" tokens = 1-3 delims = :. "% 1 in ("% time% ") Do @set t =% 1-% 2mkdir"% D% @% T % "Complete BAT --------------------------------------- @ Echo OffsetLocalFor / f "tokens = 2 delims =" %% 1 in ("% DATE%") do @set d = %% 1for / f "tokens = 1-3 delims = :." %% 1 in ("% time%" ) Do @set t = %% 1 - %% 2MKDIR "% D% @% T%" endlocal --------------------------- -------------

转载请注明原文地址:https://www.9cbs.com/read-109048.html

New Post(0)