-1

First I don't know almost anything about HTML. I have .txt file that looks like this

4WWWWWWWWWWWWW________________11111

1imeq_____________________22222

2i______________________33333

3Leteca pegla_______________44444

4name_____________________55555

1name_____________________66666

2name_____________________77777

3name_____________________88888

4name_____________________99999

1name_____________________00000

and I want to edit this page http://elektro-srb.webs.com/high-score so that it shows content of this file. File will update from time to time. "_" is actually space in file but because of some strange formatting here I changed it. I need as simple solution as it can be.

  • you can't do it using html only. – LorDex Jan 27 '14 at 17:32
  • Ok but what is next simplest solution than? – user3078694 Jan 27 '14 at 17:33
  • either load file dynamically using JS ajax, parse it and inject into your website, or process the file on backend side (php?) and return parsed result as part of your html. – LorDex Jan 27 '14 at 17:33
  • Ok but I don't know almost anything about web programming :/ i need simple solution as sample code – user3078694 Jan 27 '14 at 17:35
  • depends, where is the text file coming from, how is it being generated in the first place? you might be better off avoiding using it as a text file and just posting the data to the web server. – Mike Jan 27 '14 at 17:35
  • http://stackoverflow.com/questions/5299471/php-parsing-a-txt-file – LorDex Jan 27 '14 at 17:37
  • I upload it with c program using curl as .txt file and its being uploaded to some other host site. – user3078694 Jan 27 '14 at 17:37

1 Answers1

0

You can't do it with HTML. HTML is a markup language, you can't include a dynamic text in it.

You can use iframe and load the .txt file as a source, but note that this is not a vaild HTML format.

<iframe src="your_file.txt" />

If you're using s server side language you can load the .txt content. For example in php:

<?php
    echo file_get_contents("your_file.txt");
?>
Itay Gal
  • 10,706
  • 6
  • 36
  • 75