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 = "
| " & replace_chars(field(0)) & " | " & replace_chars(field(1)) & " |
|---|---|
| " & replace_chars(field(0)) & " | " & replace_chars(field(1)) & " |