I have the following PHP that reads in a CSV file and outputs rows/cells of an HTML table. Can someone help me with an ASP.net equivalent?
<?php
$f = fopen("spreadsheet.csv", "r");
while (($line = fgetcsv($f)) !== false) {
if(trim($line) != '' && $line != "\n" && $line != "\r") {
echo '<tr>';
foreach ($line as $cell) {
echo "<td>" . htmlspecialchars($cell) . "</td>";
}
echo "</tr>\n";
}
}
fclose($f);
?>
I see various options like http://github.com/claco/csvdatareader/ but being clueless about ASP.net, I'm afraid I don't know how to make them work.