[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 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

回复 1# a851409092


请参考Q-04和Q-05把bat文件和txt文件都保存为ANSI编码:
https://mp.weixin.qq.com/s/Koje4FufWxWBs7ioDy_LJA
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. (for /f "delims=" %%i in ('type "Old.txt"') do (
  4.     set "str=%%i"
  5.     if "!str:~72!" neq "" (
  6.         echo,%%i
  7.     )
  8. ))>"New.txt"
复制代码
1

评分人数

    • ngd: 好思路技术 + 1
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

返回列表