⑴ 关于bat批处理过滤文件字符的问题
你可以把234.txt的内容粘贴出来
你这样弄一张图片怎么编辑呐?
观察了一下
发现你要的这个回红色标记是以答空格作为分割符
取的第八列
并且带有数字
for /f "tokens=8* delims= " %%a in ('type 234.txt') do echo %%a|findstr [0-9]
⑵ 请问怎样的文本过滤如何写VBS或者BAT代码
Set FSO = CreateObject("Scripting.FileSystemObject")
set f=fso.opentextfile("a.txt",1)
Dim MyArray()
i=0
Do Until f.AtEndOfStream
ReDim Preserve MyArray(i)
MyArray(i)=f.readline
i=i+1
loop
f.close
length = UBound(MyArray)
i=0
while i<length
w=instr(MyArray(i),"@")
if w<>0 then
y=mid(MyArray(i),1,w-1)
j=i+1
while j<=length
w=instr(MyArray(j),"@")
if w<>0 then
y1=mid(MyArray(j),1,w-1)
if y=y1 then
MyArray(j)="*"
end if
end if
j=j+1
wend
end if
i=i+1
wend
Dim NewArray()
j=0
i=0
while i<=length
if MyArray(i)<>"*" then
reDim Preserve NewArray(j)
NewArray(j)=MyArray(i)
j=j+1
end if
i=i+1
wend
set f=fso.opentextfile("a1.txt",2,true)
length = UBound(NewArray)
i=0
while i<=length
f.writeline NewArray(i)
i=i+1
wend
f.close
msgbox "OK"
说明:程序编的有些拙劣,不过可以实现你的操作
程序中“@”为英文模式
结果生成“.txt”文件
VBS代码