求一个批处理,删除TXT文件内的中文汉字和所有类型的标点符号以及空格,换行要求保留。

求一个批处理,删除TXT文件内的中文汉字和所有类型的标点符号以及空格,换行要求保留。
是客户的联系方式,想要删除文档中的汉字和标点符号,只保留电话号码,求批处理代码。
只李冲保留电话号码?

file="1.txt" '文件路径
set open=createobject("scripting.filesystemobject")
function replacestr(byval text)
j = Text
For Each i In Split(Text, vbCrLf)
For k = 1 To Len(i)
If IsNumeric(Mid(i, k, 1)) = False Then
If Mid(i, k, 1) <> NL And Mid(i, k, 1) <> Space(1) Then j = Replace(j, Mid(i, k, 1), "")
End If
Next
Next
replacestr=j
end function
read=open.opentextfile(file).readall
str=split(trim(replacestr(read)),vbcrlf)
for each i in str
if i<尺岩>"" then newstr=newstr&i&vbcrlf
next
newstr=left(newstr,len(newstr)-2)
open.createtextfile("change_"&file).write newstr
'保存为陵扰御vbs类型文件
@echo off
(for /f "skip=1 tokens=2 delims=:" %%i in (a.txt) do echo %%i)>b.txt
notepad b.txt
← 上一篇: 下一篇: →