1.txt内容如下:- 1,D1,40419494.02,2947721.673,596.448
- 1,,40419351.35,2947732.962,598.3478
- 1,,40419344.61,2947277.154,603.153
- 1,,40418602.05,2947109.665,594.418
- 1,,40418523.15,2947125.589,594.665
- 1,,40418341.76,2946954.128,593.437
- 1,D7,40417975.93,2946703.767,588.376
- 1,,40417994.06,2946652.564,587.968
- 1,,40418082.93,2946562.454,587.923
- 1,,40418094.23,2946406.646,584.891
- 1,,40418102.05,2946292.159,580.774
复制代码 1.bat内容如下:- @echo off
- for /f "delims=, tokens=2,3,4,5" %%a in ('type 1.txt') do (
- echo %%a>pul
- set sj=%%a
- if %sj% neq "" echo %%a%%b%%c%%d>>2.txt
- )
- pause
复制代码 小弟的意思是以逗号作为分隔符,如果1.txt第二列的哪一行不为空的话就把那一行提取出来,放到2.txt里面,但是我这个批处理双击后本来应该把D1和D7这两行提取出来的,但是一闪而过了,也没生成2.txt,不知道怎么回事,请各位大大给小弟看看,不胜感激! |