本帖最后由 pcl_test 于 2015-4-20 11:15 编辑
- @echo off &setlocal enabledelayedexpansion
- set "folder=处理结果"
- md "%folder%\" 2>nul
- for /f "delims=" %%z in ('dir /b *.txt') do (
- set n=0
- (for /f "tokens=1,2* delims=|" %%a in ('type "%%z"') do (
- if "%%c" neq "" (
- for /f "tokens=1*" %%d in ("%%b") do (
- set/a n+=1
- set "str=¥ !n!"
- echo,%%a^|%%d!str:~-6!^|%%c
- ))))>"%folder%\%%z"
- )
- pause
复制代码
|