Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Csv to html converter extraneous character
Message
De
07/06/2002 12:36:04
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
07/06/2002 12:14:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00666020
Message ID:
00666028
Vues:
16
Albert,
SUBSTR(lcText, 1, LEN(lcText) - LEN("<tr><td>") - 1)
Cetin
>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
>
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform