- @echo off&setlocal enabledelayedexpansion
-
- for /f "delims=" %%i in ('dir /b *.csv') do (
- set name=%%i
- for /f "tokens=1-4 delims=," %%a in (!name!) do (
- set one=%%a
- set two=%%b
- set three=%%c
- set lastchar=%%d
- set lastchar=!lastchar:T=!
- echo !one!,!two!,!three!,!lastchar!>>new!name!
- )
- )
- echo Done !! and press any to exit
- pause
复制代码
|