Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display text file content
Message
 
À
19/07/2006 21:24:06
Information générale
Forum:
Internet
Catégorie:
Active Server Page
Divers
Thread ID:
01137474
Message ID:
01137991
Vues:
10
>Hi,
>
>Thank for your help. Suppose my text file contain like this:
>
>Hello....
>Good morming.
>
>
>So when the html page read the text file....how does it know have to go to the next line? Instead of displaying Hello....Good morning.
>
>Thanks.
>
>regards
>Kusnardi


Hello Kusnardi,

By default, as Naomi points out, the carriage returns and line breaks in your text file will be ignored as the contents of the test file are placed into the HTML stream.

You have two options. One is to parse the text file as you read it, and insert the appropriate
< P > and < BR >
tags, as Naomi suggests. This can be a little complicated if the file is exceptionlly large, or contains a lot of formatting.

The second thing you can do is use the
< PRE > < /PRE >
HTML tags. Essentially, any text that gets inserted between these two tags is rendered as is, including all carriage returns and line breaks, when placed in the HTML stream. The quick way to accomplish what you are trying to do is to dump the contents of the text file between these tags when writing to the browser.
Phil
_____________________________
Phil Miles
http://www.philmiles.com
phil@philmiles.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform