Ok, call me lazy, but I think this will help. I did the same thing except I pulled two values from a form and wrote them to a file. I'm just going to give you that code, sound good?
'write file
Function WriteToFile(FileName, Contents, Append)
'On Error Resume Next
If Append = True Then
iMode = 8
Else
iMode = 2
End If
Set oFs = Server.CreateObject("Scripting.FileSystemObject"

Set oTextFile = oFs.OpenTextFile(FileName, iMode, True)
oTextFile.WriteLine Contents
oTextFile.Close
Set oTextFile = Nothing
Set oFS = Nothing
End Function
'Implementation
set oFs = Server.CreateObject("Scripting.FileSystemObject"

oFs.CreateTextFile strPathToFile, True
For x = 1 to Request.Form.Count
fieldName = Request.Form.Key(x)
fieldValue = Request.Form.Item(x)
'*** this is where you manually format the output to the file by line
strToFile = fieldName & ", " & fieldValue & ",*"
If fieldValue <> "Ok" Then
WriteToFile strPathToFile, strToFile, True
End If
Next
HAPPY PROGRAMMING
sjuarez1979