Set objfso = CreateObject("Scripting.FileSystemObject") parent_folder = objfso.GetParentFolderName(WScript.ScriptFullName) & "\" Set objcsv = objfso.OpenTextFile(parent_folder & "in.csv",1,False) Set objhtml = objfso.OpenTextFile(paren_folder & "out.html",2,True) objhtml.Write(csv_to_html(objcsv.ReadAll)) objcsv.Close objhtml.Close Set objfso = Nothing Function csv_to_html(s) row = Split(s,vbCrLf) 'write the header tmp = "" For i = 0 To UBound(row) field = Split(row(i),",") If i = 0 Then tmp = tmp & "" Else tmp = tmp & "" End If Next 'write the footer tmp = tmp & "
" & replace_chars(field(0)) & "" & replace_chars(field(1)) & "
" & replace_chars(field(0)) & "" & replace_chars(field(1)) & "
" csv_to_html = tmp End Function Function replace_chars(s) replace_chars = Replace(Replace(s,"<","<"),">",">") End Function