HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: exclude httrack comments from mirrored pages
Author: Gadrin
Date: 10/19/2008 18:13
 
This took about 10 minutes to create. Copy this into a file called
"Edit-HTTrack-Comments.vbs", you can use Notepad.


'	for /R  J:\Temporary %f in (*.htm) do "N:\Edit-HTTrack-Comments.vbs" "%f"  
' DOS command line...

  '	setup some constants...
  Const ForReading = 1, ForWriting = 2, ForAppending = 8
  '	dimension some variables...
  Dim fso, f, FileText, FileName
  'msgbox WScript.Arguments.item(0),, "Da File"
  ' get the argument passed to the script...
  FileName = WScript.Arguments.item(0)
  ' create the file system object, then open the file for reading...
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.OpenTextFile(FileName, ForReading, True)
  '	read the entire contents into a variable...
  FileText = f.ReadAll
  '	all done close the file
  f.close
  set f = nothing
  
  '	now make the edits from the text of the old file, to the new text...
  
  on error resume next    ' necessary just in case a file doesn't contain
comments, should be ignored
  
  dim spos, epos, comment
  spos = InStr(1, FileText, "<!-- Mirrored from")  ' Find the initial comment
  epos = InStr(spos, FileText, "-->")				' Find the end of the comment
  comment = Mid(FileText, spos, epos-spos+3)
  FileText = Replace(FileText, comment, "")			' replace the comment with blank
string	
  
  'msgbox comment,,"Comment"
  
  '	write the new contents, close up and go home...
  Set f = fso.OpenTextFile(FileName, ForWriting, True)
  f.WriteLine FileText
  f.close
  
  set f   = nothing
  set fso = nothing





'>
 
Reply Create subthread


All articles

Subject Author Date
exclude httrack headers from mirrored pages

10/17/2008 08:39
exclude httrack comments from mirrored pages

10/17/2008 09:15
Re: exclude httrack comments from mirrored pages

10/19/2008 15:31
Re: exclude httrack comments from mirrored pages

10/19/2008 18:13
Re: exclude httrack comments from mirrored pages

10/19/2008 18:18
Re: exclude httrack comments from mirrored pages

10/20/2008 19:09
Re: exclude httrack comments from mirrored pages

01/12/2009 22:46




5

Created with FORUM 2.0.11