来个简单但不严谨的- Set fso = CreateObject("Scripting.FileSystemObject")
- text = fso.OpenTextFile("1.txt",1).ReadAll()
- text = Replace(text,vbCrLf,"@SOCKS4"&vbCrLf)
- text = Replace(text,vbCrLf&"@SOCKS4",vbCrLf)
- fso.CreateTextFile("2.txt",True).Write(text)
复制代码 再来个稍微严谨点的- Set fso = CreateObject("Scripting.FileSystemObject")
- text = fso.OpenTextFile("1.txt",1).ReadAll()
- arr = Split(text,vbCrLf)
- For i=0 To UBound(arr)
- If Len(arr(i)) Then arr(i)=arr(i)&"@SOCKS4"
- Next
- text = Join(arr,vbCrLf)
- fso.CreateTextFile("2.txt",True).Write(text)
复制代码 其实还是用正则比较好,但 vbs 的正则懒得写 |