|
tclshx
中级用户
  
积分 249
发帖 64
注册 2005-6-3
状态 离线
|
『楼 主』:
求一个删除行的批处理
使用 LLM 解释/回答一下
有一A.TXT文件,在其中找到JKLJHLL时,删除含有JKLJHLL字符串的行(不分大小写).
There is an A.TXT file. When finding JKLJHLL in it, delete the lines containing the string JKLJHLL (case-insensitive).
|
|
2006-10-18 05:13 |
|
|
pengfei
银牌会员
    
积分 1218
发帖 485
注册 2006-7-21 来自 湖南.娄底
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
@echo off
for /f "delims=" %%i in ('findstr /i /v /c:JKLJHLL a.txt') do (
echo %%i>>temp.txt
)
start temp.txt
不知是否为楼主要求的效果...
@echo off
for /f "delims=" %%i in ('findstr /i /v /c:JKLJHLL a.txt') do (
echo %%i>>temp.txt
)
start temp.txt
I wonder if this is the effect the poster requested...
|
|
2006-10-18 05:21 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
顶一个~~
findstr /v用得妙~~
Give it a thumbs up~~
findstr /v is clever~~
|
|
2006-10-18 07:48 |
|
|
tclshx
中级用户
  
积分 249
发帖 64
注册 2005-6-3
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
Originally posted by pengfei at 2006-10-18 05:21 AM:
@echo off
for /f "delims=" %%i in ('findstr /i /v / JKLJHLL a.txt') do (
echo %%i>>temp.txt
)
start temp.txt
不知是否为楼主要求的效果...
谢谢了!
Originally posted by pengfei at 2006-10-18 05:21 AM:
@echo off
for /f "delims=" %%i in ('findstr /i /v / JKLJHLL a.txt') do (
echo %%i>>temp.txt
)
start temp.txt
I wonder if this is the effect the poster requested...
Thank you!
|
|
2006-10-18 08:16 |
|
|
mountvol
初级用户
 
积分 186
发帖 117
注册 2006-8-14
状态 离线
|
|
2006-10-18 11:07 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
这个更强,我顶!!!
This is even stronger, I support it!!!
|
|
2006-10-18 11:25 |
|
|
pengfei
银牌会员
    
积分 1218
发帖 485
注册 2006-7-21 来自 湖南.娄底
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Originally posted by mountvol at 2006-10-18 11:07:
findstr /ivc:"JKLJHLL" a.txt >b.txt
OK, 这里完全可以不用FOR.
Originally posted by mountvol at 2006-10-12:07:
findstr /ivc:"JKLJHLL" a.txt >b.txt
OK, you can completely do without FOR here.
|
|
2006-10-18 22:48 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Originally posted by mountvol at 2006-10-18 11:07:
findstr /ivc:"JKLJHLL" a.txt >b.txt
顶~~给你加了6分~:)
Originally posted by mountvol at 2006-10-18 11:07:
findstr /ivc:"JKLJHLL" a.txt >b.txt
Top~Gave you 6 points~: )
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2006-10-18 22:52 |
|
|
pillow
初级用户
 
积分 196
发帖 82
注册 2005-9-26
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
搜“删除行”只查到这一个帖子,
我要处理的问题有点极端,需要将A文件中有而B文件中没有的行比较出来
两个TXT文件,分别有5000+(命名为A)和2000+(命名为B),
这若是用以上的>方式岂不是要生成几千个文件?
而且似乎也谈不上效率了,请问哪位知道有没有用P处理的更好思路?
Searching "delete lines" only found this one post.
The problem I need to handle is a bit extreme. I need to compare the lines that are in file A but not in file B.
There are two TXT files, with more than 5000 lines (named A) and more than 2000 lines (named B) respectively.
If I use the above > method, wouldn't it be necessary to generate thousands of files?
And it doesn't seem to be efficient. Does anyone know if there is a better idea using P to handle it?
|
|
2007-12-12 15:34 |
|
|
ZJHJ
高级用户
   
积分 609
发帖 374
注册 2006-8-2
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Originally posted by pillow at 2007-12-12 15:34:
搜“删除行”只查到这一个帖子,
我要处理的问题有点极端,需要将A文件中有而B文件中没有的行比较出来
两个TXT文件,分别有5000+(命名为A)和20 ...
用B+A------用删除重复行-------查找B和A之间的标记行数------用more +n提取
Originally posted by pillow at 2007-12-12 15:34:
Searching "delete line" only finds this one post,
The problem I need to handle is a bit extreme. I need to compare the lines that are in file A but not in file B.
There are two TXT files, with more than 5000 lines (named A) and 20 ...
Use B + A ------ Use delete duplicate lines ------ Find the number of marked lines between B and A ------ Use more +n to extract
|
|
2007-12-16 22:15 |
|
|
hellen
中级用户
  
积分 205
发帖 32
注册 2004-2-6
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
这个命令我还是没有用过,不太会!
I haven't used this command yet, and I don't know how to!
|
|
2008-2-27 20:45 |
|
|
kollar
新手上路

积分 8
发帖 3
注册 2007-5-29
状态 离线
|
『第 12 楼』:
FINDSTR: 搜索字符串太长
使用 LLM 解释/回答一下
在我的例子上使用了以后,报FINDSTR: 搜索字符串太长。的错误,该如何是好?
After using it in my example, the error "FINDSTR: The search string is too long" is reported. What should I do?
|
|
2008-3-5 10:33 |
|
|
pyjhhh
初级用户
 
积分 54
发帖 26
注册 2007-2-10
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
找 汉字字符可真够慢的了
Finding Chinese characters is really slow
|
|
2008-6-2 03:22 |
|
|
liyyhh
初级用户
 
积分 48
发帖 27
注册 2008-6-1
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
够专业呀,看不懂。
It's professional enough, I can't understand.
|
|
2008-6-2 14:02 |
|