source$ = "C:\excel\ballvibe.csv" 'Source file (.CSV) result$ = "C:\out.html" 'Destination file (.HTML), overwrites. REM Converts CSV file to HTML TABLE. REM Automatically detects number of fields. OPEN source$ FOR INPUT AS 1 OPEN result$ FOR OUTPUT AS 2 CLS LINE INPUT #1, A$ CLOSE #1 OPEN source$ FOR INPUT AS 1 cells=0 fields = 1 FOR n = 1 TO LEN(A$) IF MID$(A$, n, 1) = "," THEN fields = fields + 1 NEXT PRINT fields; "fields" PRINT #2, "" WHILE NOT EOF(1) PRINT #2, "" FOR n = 1 TO fields '9 = the number of fields. PRINT #2, "" NEXT PRINT #2, "" WEND PRINT #2, "
"; cells=cells + 1 INPUT #1, A$ PRINT #2, ""; PRINT #2, A$; PRINT #2, "
" CLOSE PRINT "Done. ";cells;" Cells."