const CLASSES_FILES_FOLDER = "c:\temp\files"
set fso = createobject("scripting.filesystemobject")
Set objFolder = fso.GetFolder(CLASSES_FILES_FOLDER)
For Each objFile In objFolder.Files
token = ""
select case fso.GetExtensionName(objFile)
case "cs": token = "///"
case "vb": token = "'''"
end select
if token <> "" then
RemoveSummary objFile.Path, token
end if
Next
sub RemoveSummary(filename, token)
set objSrcFile = fso.OpenTextFile(filename, 1)
data = ""
match = false
Do Until objSrcFile.AtEndOfStream
strLine = objSrcFile.Readline
if InStr(strLine, token & " <summary>") > 0 then
match = true
else
if match = true then
if InStr(strLine, token) = 0 then
match = false
data = data & strLine & vbNewLine
end if
else
data = data & strLine & vbNewLine
end if
end if
Loop
objSrcFile.Close
set objOutFile = fso.CreateTextFile(filename, 2)
objOutFile.Write data
objOutFile.Close
end sub
|