Okay - I've played with this in excel and VBA and have the bones of a script:
Sub Macro1() Application.ScreenUpdating = False Do If InStr(ActiveCell.Value, "<timestamp>") > 0 Then If Mid(ActiveCell.Value, 18, 4) < 2010 Then Do ActiveCell.Offset(-1, 0).Select Loop Until InStr(ActiveCell.Value, "<revision>") > 0 Do Selection.Delete Shift:=xlUp Loop Until InStr(ActiveCell.Value, "</revision>") > 0 Selection.Delete Shift:=xlUp Else ActiveCell.Offset(1, 0).Select End If Else If InStr(ActiveCell.Value, "<siteinfo>") > 0 Then Do Selection.Delete Shift:=xlUp Loop Until InStr(ActiveCell.Value, "</siteinfo>") > 0 Selection.Delete Shift:=xlUp Else ActiveCell.Offset(1, 0).Select End If End If Loop Until InStr(ActiveCell.Value, "</mediawiki>") > 0 Application.ScreenUpdating = TrueEnd Sub
I'd like to do the same with a VBS that will also:
Open the XML as though it were a text file
work on a line-by-line basis instead of a cell by cell basis
Who can bail me out here?