Question : How can i remove all <summary> tags and the comments inside them?

I want to remove all the <summary> tags including the content inside them in a class file.

So if i want to remove all the following with one operation

<summary>
blablabla
</summary>

How can i do this?

Answer : How can i remove all <summary> tags and the comments inside them?

made  a mistake in the script, here's the working one:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
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
Random Solutions  
 
programming4us programming4us