本帖最后由 pcl_test 于 2015-2-22 12:36 编辑
回复 1# 思想之翼 - @echo off
- setlocal enabledelayedexpansion
- cd /d "D:\数据\"
- for /f "delims=" %%a in ('dir /b *.txt') do (
- for /f "delims=" %%b in ('type "%%a"') do (
- set "str=%%b"
- set t=
- for /l %%c in (0 1 5) do (
- if "!str:~%%c,1!" == "0" (
- set "t=!t!1!str:~%%c,1! "
- ) else (
- set "t=!t!0!str:~%%c,1! "
- )
- )
- >>$ echo,!t:~0,-1!
- )
- move $ "%%a"
- )
- pause
复制代码
|