Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Csv to html converter extraneous character
Message
De
07/06/2002 12:14:24
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Csv to html converter extraneous character
Divers
Thread ID:
00666020
Message ID:
00666020
Vues:
57
I wrote this little converter program, but I see a ">" near the beginning of the page when the HTML is viewed in IE. Does anybody have a clue what I am missing?
lparameters tcCharacterSet
LOCAL i, lcFileName, lcText, lcCharacterSet
LOCAL ARRAY laFiles[1]

if vartype(tcCharacterSet) = 'C'
	lcCharacterSet = tcCharacterSet
else
	lcCharacterSet = "windows-1251"
endif

FOR i = 1 to ADIR(laFiles, "*.csv")
	lcFileName = laFiles[i, 1]
	lcText = FILETOSTR(lcFileName)
	lcText = STRTRAN(lcText, CHR(13), "</td></tr>" + CHR(13) + CHR(10) + "<tr><td>")
	lcText = STRTRAN(lcText, ",", "</td><td>")
	lcText = "<tr><td>" + SUBSTR(lcText, 1, LEN(lcText) - LEN("<tr><td>"))
	buildHTML(lcFileName, lcText, FORCEEXT(lcFileName, "html"), lcCharacterSet)
ENDFOR
RETURN

FUNCTION buildHTML (tcTitle, tcOutput, tcOutputFile, tcCharacterSet)

set textmerge to (tcOutputFile) noshow
set textmerge on
text
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<<tcCharacterSet>>">
	<title><<tcTitle>></title>
</head>
<body>
<table>
<<tcOutput>>
</table>
</body>
</html>
endtext
set textmerge off
set textmerge to
ENDFUNC
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform