title: Output XMLHttp response line by line
body: <p>I need to grab a log file from a URL and then print the log file line by line. I can successfully get the file this way:</p>
  
  <pre><code>Dim filePath,fileName
  
  filePath = "http://localhost/osat/spawn_pi_logs"
  fileName = "/Spawn.log"
  FilePath = filePath &amp; fileName
  Set req = CreateObject("Msxml2.XMLHttp.6.0")
  req.open "GET", FilePath, False
  req.send
  
  If req.Status = 200 Then
      Response.Write "Found the file&lt;br&gt;"
      Response.Write req.responsetext
  End If
  </code></pre>
  
  <p>That code writes the text of my log file to the screen in one huge ugly blob.  I want to walk through it, format it, search it, etc and write it out with code similar to this:</p>
  
  <pre><code>Do While Not TextStream.AtEndOfStream
      Dim sLine
      sLine = TextStream.readLine
      sLine = sLine &amp; "&lt;br&gt;"
      Response.Write sLine
  Loop
  </code></pre>
  
  <p>However, how do I convert my req object (which has a generic stream at req.ResponseStream) and convert it to a Text Stream?</p>