本帖最后由 pcl_test 于 2016-8-15 23:50 编辑
- @echo off&setlocal enabledelayedexpansion
- findstr /v /r /c:"^[ ]*," /c:"^王1" "000.csv">$
- move $ "000.csv"&rem 覆盖原文件,注意备份
- findstr /r "姓名 ^[^,]*,[1-9], ^[^,]*,1[0-9] ^[^,]*,2[0-5]" "000.csv">"001.csv"
- for /f "delims=" %%a in ('more +9 "%~f0"') do set "%%a"
- for /f "delims=" %%a in ('type "000.csv"') do (
- for /f "tokens=7 delims=," %%b in ("%%a") do echo;%%a,!%%b!
- )
- pause&exit
- 北京=1
- 福建=2
- 广东=3
- 湖南=4
复制代码
|