请问如何删除TXT文档中每行中前20字符

删除前2011-11-2417:32:56DLL(IK_ID_OPENUSER)->CARD:411524199305080010,Validate:02011-11-2... 删除前2011-11-24 17:32:56 DLL(IK_ID_OPENUSER)->CARD:411524199305080010, Validate:0
2011-11-24 17:45:45 DLL(IK_ID_OPENUSER)->CARD:411524199305080010, Validate:0
2011-11-24 17:57:36 DLL(IK_ID_OPENUSER)->CARD:413026198310280335, Validate:0
2011-11-24 18:07:07 DLL(IK_ID_OPENUSER)->CARD:411524199106032710, Validate:0
2011-11-24 18:09:04 DLL(IK_ID_OPENUSER)->CARD:411524199309070012, Validate:0
2011-11-24 18:24:55 DLL(IK_ID_OPENUSER)->CARD:413027197401020039, Validate:0
删除后DLL(IK_ID_OPENUSER)->CARD:411524199305080010, Validate:0
DLL(IK_ID_OPENUSER)->CARD:411524199305080010, Validate:0
DLL(IK_ID_OPENUSER)->CARD:413026198310280335, Validate:0
DLL(IK_ID_OPENUSER)->CARD:411524199106032710, Validate:0
DLL(IK_ID_OPENUSER)->CARD:411524199309070012, Validate:0
DLL(IK_ID_OPENUSER)->CARD:413027197401020039, Validate:0
展开
 我来答
yyykkkyyyy
2012-01-04 · TA获得超过3136个赞
知道大有可为答主
回答量:2691
采纳率:40%
帮助的人:3274万
展开全部
把下面代码用记事本保存为xx.bat 放在那txt文件同位置运行(假定文件名a.txt)则删去每行前20字符 :
@echo off
set fn=a.txt
(for /f "usebackq delims=" %%i in ("%fn%")do (
echo;%%i>con
set "h=%%i"
setlocal enabledelayedexpansion
echo;!h:~20!
endlocal))>b.txt
move b.txt "%fn%"
pause
不过换一种规则更好,就是把每行第二处空格前的去掉:
@echo off
set fn=a.txt
(for /f "usebackq tokens=2*" %%i in ("%fn%")do (
echo;%%j>con&echo;%%j
))>b.txt
move b.txt "%fn%"
pause
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式