We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
textFile = "C:\temp\04test.txt" saveTo = "C:\temp\" writeTo = "" headingPattern = "(GROUP*)" dim fso,fileFrom,regex set fso = CreateObject("Scripting.FileSystemObject") set fileFrom = fso.OpenTextFile(textFile) set regex = new RegExp with regex .Pattern = headingPattern .IgnoreCase = false .Global = True end with while fileFrom.AtEndOfStream <> true line = fileFrom.ReadLine set matches = regex.Execute(line) if matches.Count > 0 then writeTo = saveTo & matches(0).SubMatches(0) & ".txt" set fileTo = fso.CreateTextFile(writeTo) else fileTo.WriteLine(line) end if wend set fileFrom = nothing set fso = nothing set regex = nothing
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.