本帖最后由 apang 于 2013-12-17 10:26 编辑
- Set fso = CreateObject("Scripting.FileSystemObject")
- text = fso.OpenTextFile("111.txt",1).ReadAll
-
- Set re = New RegExp
- re.Pattern = "(.*\n){50}|[\s\S]+$"
- re.Global = True
- For Each m in re.Execute(text)
- fso.OpenTextFile("123.txt",8,true).WriteLine m
- Next
复制代码
- Set fso = CreateObject("Scripting.FileSystemObject")
- txt = fso.OpenTextFile("111.txt").ReadAll
-
- Set re = New RegExp
- re.Pattern = "(.*\n){50}"
- re.Global = True
- fso.OpenTextFile("123.txt",2,true).Write re.Replace(txt,"$&" & vbCrLf)
复制代码
|