
批处理或VBS批量替换指定内容?
一个文本里面有很多网址列表,我想批量替换每行尾部为".co"的,全都都替换为".com"还有每行尾部为4位的,全部替换为".com"例如:http://www.soso....
一个文本里面有很多网址列表,我想批量替换每行尾部为".co" 的,全都都替换为".com"还有每行尾部为4位的,全部替换为".com" 例如: http://www.soso.comn 这样尾部为4位,替换为: http://www.soso.com
展开
展开全部
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set fso = CreateObject("Scripting.FileSystemObject")
Function write_text(file,str)
Set f = fso.OpenTextFile(file, 2 ,True)
f.Write str
f.Close
End Function
Function read(file)
Set f = fso.OpenTextFile(file, 1 ,True)
read= f.ReadAll
f.Close
End Function
s=read("1.txt") '1.txt源文件名
s=Replace(s,".comn",".com")
s=Replace(s,".co",".com")
s=Replace(s,".comm",".com")
write_text "1.txt",s '1.txt生成结果文件名
Set fso = CreateObject("Scripting.FileSystemObject")
Function write_text(file,str)
Set f = fso.OpenTextFile(file, 2 ,True)
f.Write str
f.Close
End Function
Function read(file)
Set f = fso.OpenTextFile(file, 1 ,True)
read= f.ReadAll
f.Close
End Function
s=read("1.txt") '1.txt源文件名
s=Replace(s,".comn",".com")
s=Replace(s,".co",".com")
s=Replace(s,".comm",".com")
write_text "1.txt",s '1.txt生成结果文件名

2024-10-28 广告
作为深圳奥凯丰科技有限公司的一员,对于zip删除文件的处理,我们可以这样回答:要打开zip压缩包中删除的文件,实际上需要首先明确文件是否真正从压缩包中移除了。如果文件已从zip中删除,那么就无法直接打开,除非有备份。但如果是指解压后删除了某...
点击进入详情页
本回答由百事牛提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询