I'm using VBScript to parse CSV data and display it on a table. I've got the CSV set up and when I open it in Sublime Text, the headers and content are on different lines (there's only one row of content besides the header). It shows two lines in Sublime Text.
The headers don't have a comma at the end of the row so it doesn't break it up and just basically appends the first entry of the second line on to the last entry of the headers line because it's not technically divided by a comma.
The code I'm using is:
<html>
<head>
</head>
<body>
<%@language="vbscript"%>
<table border="1">
<%
dim csv_to_read, fso, act
csv_to_read="sample.csv"
set fso = createobject("scripting.filesystemobject")
set act = fso.opentextfile(server.mappath(csv_to_read))
'Read the first line of the csv, typically these are colum headings
Response.Write "<tr><th>" & replace(act.readline,",","</th><th>") & "</th></tr>" & vbCrLf
'Read the rest of the csv
Response.Write "<tr><td>" & replace(replace(act.readall,vbCrLf,"</td></tr>"&vbCrLf&"<tr><td>"),",","</td><td>") & "</td></tr>"
%>
<caption>Total Number of Records: <%=act.Line-1%></caption>
</table>
</body>
</html>
Why is it not recognizing the line break?
Thanks for your help!