标题: [文本处理] bat批处理如何删除txt文本中长度不足73的内容 [打印本页]
作者: a851409092 时间: 2022-5-20 09:29 标题: bat批处理如何删除txt文本中长度不足73的内容
Y11B220408112604,LY1312010250300350,C3070103B5030292,2022/05/07/ 22:15:19
Y11B220408110234,LY1312010250300349,C30701032/05/07/ 22:18:09
Y11B2203,LY1312010250300352,C3070103B5030395,2022/05/07/ 22:19:56
Y11B220408112521,LY1312010250300345,C3070103B5030394,2022/05/07/ 22:20:57
Y11B220408105359,LY1312010250300351,C30701036,2022/05/07/ 22:19:27
Y11B220408112553,LY1312010250300352,C3070103B5030395,2022/05/07/ 22:19:56
Y11B220408112521,LY1312010250300345,C3070103B5030394,2022/05/07/ 22:20:57
Y11B220408112553,LY1312010250300352,C3070103B5030395,2022/05/07/ 22:19:56
Y11B220408112521,LY1312010250300345,C3070103B5030394,2022/05/07/ 22:20:57
Y11B220408112553,LY1312010250300352,C3070100395,2022/05/07/ 22:19:56
Y11B220408112521,LY1312010250300345,C3070103B5030394,2022/05/07/ 22:20:57
Y11B220408112553,LY1312010250300352,C3070103B5030395,2022/05/07/ 22:19:56
Y11B220408112521,LY1312010250300345,C3070103B5030394,2022/05/07/ 22:20:57
Y11B220408112553,LY1312010250300352,C3070103B5030395,2022/05/07/ 22:19:56
Y11B220408112521,LY1312010250300345,C3070103B5030394,2022/05/07/ 22:20:57
作者: Batcher 时间: 2022-5-20 09:54
回复 1# a851409092
请参考Q-04和Q-05把bat文件和txt文件都保存为ANSI编码:
https://mp.weixin.qq.com/s/Koje4FufWxWBs7ioDy_LJA- @echo off
- setlocal enabledelayedexpansion
- (for /f "delims=" %%i in ('type "Old.txt"') do (
- set "str=%%i"
- if "!str:~72!" neq "" (
- echo,%%i
- )
- ))>"New.txt"
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |