VBScript remove newline -
i have html page 1 or more newlines after </html>. vbscript file able find replace newlines emptiness. but, looks opentextfile putting newline @ end again. help!
'pulled interwebs const forreading = 1 const forwriting = 2 set objfso = createobject("scripting.filesystemobject") set objfile = objfso.opentextfile("a.html", forreading) strtext = objfile.readall 'wscript.echo strtext objfile.close strnewtext = replace(strtext, "</html>" & vbcrlf, "</html>") set objfile = objfso.opentextfile("a.txt", forwriting) objfile.writeline strnewtext objfile.close
instead of objfile.writeline strnewtext use objfile.write strnewtext. write file without newline @ end.
btw, way of removing newline(s) after </html> tag strnewtext = trim(strtext) instead of using replace()
Comments
Post a Comment