- Increase transparency
- Onboard new hires faster
- Access from mobile/offline
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
|Filling all the non contiguous blank cells in a column with consecutive numbers||16||58|
|backslash character VBScript runtime error: Syntax error in regular expression||2||37|
|Vb script to restart the services||13||66|
|Does anyone have a sample vb script (or vba) that opens every .xls and .xlsx file in a directory and extracts certain cells||25||57|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
15 Experts available now in Live!