TextToHtml.bat - Easily create World Wide Web pages!

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: TextToHtml.bat - Easily create World Wide Web pages!

#16 Post by foxidrive » 28 Mar 2014 06:38

A big part of the problem is that without a single tested download we can't be certain that all the files are faultless, have the right names, line endings etc.

That's why I provided the files in a zip file download - Aacini just needed to confirm they were correct and then we could have debugged it to see why it misbehaves in my system.

Matt Williamson
Posts: 78
Joined: 30 Dec 2013 10:16
Location: United States by the big waterfall

Re: TextToHtml.bat - Easily create World Wide Web pages!

#17 Post by Matt Williamson » 28 Mar 2014 07:04

Is that FTP site still up? It doesn't show the address in the thread. I'd be willing to test it on my Win7 x64 machine.

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: TextToHtml.bat - Easily create World Wide Web pages!

#18 Post by foxidrive » 28 Mar 2014 07:49

Edit: did you get it Matt?

Matt Williamson
Posts: 78
Joined: 30 Dec 2013 10:16
Location: United States by the big waterfall

Re: TextToHtml.bat - Easily create World Wide Web pages!

#19 Post by Matt Williamson » 28 Mar 2014 09:17

Yeah, that worked. I got a little further along but still can't get it working. I think it's something simple but this is a lot of code. Here is my output when I run it and a Dir listing too. HTML Files

Aacini
Expert
Posts: 1670
Joined: 06 Dec 2011 22:15
Location: México City, México

Re: TextToHtml.bat - Easily create World Wide Web pages!

#20 Post by Aacini » 28 Mar 2014 10:06

@foxi:

I want to make a test on your .zip file, but the link was deleted. Could you re-edit it?

Two notes on this program:
  • The conversion of tables takes a long time depending on the size of the table. The guide is a huge file and have several tables, so you should give enough time for the conversion. There is a table, "[table]Color table of DOS text colors", that may take a couple minutes. Please, be patient.
  • I suggest you to first convert a very simple file just to test that the conversion program is working properly. For example:

    TestFile.txt

    Code: Select all

    This is a [b]test file[/b]
    ==First section==
    This is [i]first[/i] section
    ==Second section==
    This is [b][i]second[/i][/b] section
If the conversion program fail on this file, please report exactly what happened...

Antonio

Aacini
Expert
Posts: 1670
Joined: 06 Dec 2011 22:15
Location: México City, México

Re: TextToHtml.bat - Easily create World Wide Web pages!

#21 Post by Aacini » 28 Mar 2014 10:28

Hey! I just downloaded again TextToHtml.bat file from the original site:

Code: Select all

28/03/2014  10:23 a. m.            47,500 TextToHtml.bat

but the listing of Matt Williamson show that his file have 60 bytes more!!!

Code: Select all

12/10/2013  06:06 PM            47,560 texttohtml.bat

Matt Williamson
Posts: 78
Joined: 30 Dec 2013 10:16
Location: United States by the big waterfall

Re: TextToHtml.bat - Easily create World Wide Web pages!

#22 Post by Matt Williamson » 28 Mar 2014 10:29

I just added the zip file to my dropbox folder, so you can grab it from there. Also, check out my .html output files and see if you can figure out why I keep getting all of the

Code: Select all

¿" was unexpected at this time.

All I know from 3 years of spanish is that that's how you start a question but I did a search for that upside down question mark and didn't find any in any of the files.

Aacini
Expert
Posts: 1670
Joined: 06 Dec 2011 22:15
Location: México City, México

Re: TextToHtml.bat - Easily create World Wide Web pages!

#23 Post by Aacini » 28 Mar 2014 10:55

Ok. I just downloaded the 10 files from the original site. It tokes me exactly 9 minutes 39 seconds to do so. This is the listing of files just after download:

Code: Select all

28/03/2014  10:37 a. m.             2,336 Aacini's Colors Tree.bat
28/03/2014  10:38 a. m.            77,096 Creation of World Wide Web pages.txt
28/03/2014  10:39 a. m.               624 DOSColorTable.bat
28/03/2014  10:41 a. m.             2,339 Format of the source text file.txt
28/03/2014  10:45 a. m.             4,219 HelpToTextToHtml.bat
28/03/2014  10:45 a. m.             8,798 HelpToTextToHtml.txt
28/03/2014  10:42 a. m.           130,746 InstallFiles.bat
28/03/2014  10:43 a. m.           167,599 InstallImages.bat
28/03/2014  10:44 a. m.             1,292 ModifiersForCodeTag.txt
28/03/2014  10:23 a. m.            47,500 TextToHtml.bat
              10 archivos        442,549 bytes

I then executed InstallFiles.bat that took 2 minutes 14 seconds. This is the listing of files after the installation:

Code: Select all

28/03/2014  10:49 a. m.             1,069 A01.gif
28/03/2014  10:49 a. m.             1,222 A02.gif
28/03/2014  10:49 a. m.             1,381 A03.gif
28/03/2014  10:49 a. m.             1,475 A04.gif
28/03/2014  10:49 a. m.             1,562 A05.gif
28/03/2014  10:49 a. m.             1,623 A06.gif
28/03/2014  10:49 a. m.             1,708 A07.gif
28/03/2014  10:49 a. m.             1,854 A08.gif
28/03/2014  10:49 a. m.             1,909 A09.gif
28/03/2014  10:49 a. m.             1,909 A10.gif
28/03/2014  10:49 a. m.             1,907 A11.gif
28/03/2014  10:49 a. m.             1,772 A12.gif
28/03/2014  10:49 a. m.             1,657 A13.gif
28/03/2014  10:49 a. m.             1,567 A14.gif
28/03/2014  10:49 a. m.             1,488 A15.gif
28/03/2014  10:49 a. m.             1,402 A16.gif
28/03/2014  10:49 a. m.             1,301 A17.gif
28/03/2014  10:49 a. m.             1,154 A18.gif
28/03/2014  10:37 a. m.             2,336 Aacini's Colors Tree.bat
28/03/2014  10:49 a. m.            18,051 Aacini's Colors Tree.html
28/03/2014  10:49 a. m.             7,102 Aacini's Colors Tree.txt
28/03/2014  10:51 a. m.           130,558 Creation of World Wide Web pages.html
28/03/2014  10:38 a. m.            77,096 Creation of World Wide Web pages.txt
28/03/2014  10:39 a. m.               624 DOSColorTable.bat
28/03/2014  10:49 a. m.            11,190 DOSColorTable.txt
28/03/2014  10:41 a. m.             2,339 Format of the source text file.txt
28/03/2014  10:45 a. m.             4,219 HelpToTextToHtml.bat
28/03/2014  10:45 a. m.             8,798 HelpToTextToHtml.txt
28/03/2014  10:42 a. m.           130,746 InstallFiles.bat
28/03/2014  10:43 a. m.           167,599 InstallImages.bat
28/03/2014  10:51 a. m.                 0 list.txt
28/03/2014  10:44 a. m.             1,292 ModifiersForCodeTag.txt
28/03/2014  10:49 a. m.            14,256 mueller_hut.jpg
28/03/2014  10:49 a. m.             9,630 Tetris Aqua.gif
28/03/2014  10:49 a. m.             9,595 Tetris Blue.gif
28/03/2014  10:49 a. m.            10,101 Tetris Fuchsia.gif
28/03/2014  10:49 a. m.             9,457 Tetris Gray.gif
28/03/2014  10:49 a. m.            10,149 Tetris Layout.gif
28/03/2014  10:49 a. m.             9,527 Tetris Lime.gif
28/03/2014  10:49 a. m.             9,603 Tetris Red.gif
28/03/2014  10:49 a. m.             9,677 Tetris Yellow.gif
28/03/2014  10:23 a. m.            47,500 TextToHtml.bat
28/03/2014  10:49 a. m.             1,865 w3c_home.gif
28/03/2014  10:49 a. m.             1,578 w3c_home0.gif
28/03/2014  10:49 a. m.             1,578 w3c_home3.gif
28/03/2014  10:49 a. m.             1,577 w3c_home6.gif
28/03/2014  10:49 a. m.             1,576 w3c_home9.gif
28/03/2014  10:49 a. m.             1,560 w3c_homeC.gif
28/03/2014  10:49 a. m.             1,522 w3c_homeLB.gif
28/03/2014  10:49 a. m.             1,535 w3c_homeLT.gif
28/03/2014  10:49 a. m.             1,522 w3c_homeRB.gif
28/03/2014  10:49 a. m.             1,527 w3c_homeRL.gif
28/03/2014  10:49 a. m.             1,546 w3c_homeRT.gif
              53 archivos        746,791 bytes

All is working correctly...

Antonio

Matt Williamson
Posts: 78
Joined: 30 Dec 2013 10:16
Location: United States by the big waterfall

Re: TextToHtml.bat - Easily create World Wide Web pages!

#24 Post by Matt Williamson » 28 Mar 2014 11:04

Hmm. I'm thinking it's something in the code that works properly on your version of windows and doesn't work on ours? I can't think of anything else and those upside down question marks are the key in my mind since we don't use them in English. They appear in every output .html file that gets generated.

Here is what I got when I ran it against the testfile.txt

Code: Select all

testfile

¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time.
This is a [b]test file[/b]

Table of Contents

First section ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time.
Second section ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time. ¿" was unexpected at this time.
First section

This is [i]first[/i] section
Top

Second section

This is [b][i]second[/i][/b] section

Aacini
Expert
Posts: 1670
Joined: 06 Dec 2011 22:15
Location: México City, México

Re: TextToHtml.bat - Easily create World Wide Web pages!

#25 Post by Aacini » 28 Mar 2014 11:18

Matt Williamson wrote:Hmm. I'm thinking it's something in the code that works properly on your version of windows and doesn't work on ours? I can't think of anything else and those upside down question marks are the key in my mind since we don't use them in English. They appear in every output .html file that gets generated.

Did you tested the files downloaded from the original site? The conversion program you downloaded from foxi´s .zip file have 60 bytes more!

Matt Williamson
Posts: 78
Joined: 30 Dec 2013 10:16
Location: United States by the big waterfall

Re: TextToHtml.bat - Easily create World Wide Web pages!

#26 Post by Matt Williamson » 28 Mar 2014 11:28

Yes, I used the latest file from your site when I tested it.

Aacini
Expert
Posts: 1670
Joined: 06 Dec 2011 22:15
Location: México City, México

Re: TextToHtml.bat - Easily create World Wide Web pages!

#27 Post by Aacini » 28 Mar 2014 12:20

EDIT

I originally posted here the full source code of TextToHtml.bat program in order to aid to find a supposed major bug in the program. However, such bug doesn't exist, so I opted for delete the huge listing...

Antonio
Last edited by Aacini on 28 Mar 2014 22:41, edited 1 time in total.

aGerman
Expert
Posts: 3971
Joined: 22 Jan 2010 18:01
Location: Germany

Re: TextToHtml.bat - Easily create World Wide Web pages!

#28 Post by aGerman » 28 Mar 2014 13:34

I haven't tested yet but the only "natural occurrence" of a ¿ character I can think of is the BOM of UTF-8 encoded text (or even Batch code).
UTF-8 could be the default charset depending on the text editor you used.

Regards
aGerman

EDIT:
As soon as the Batch code is UTF-8 encoded the HTML is full of these error messages.

Code: Select all

...
<body>
<h1>test</h1>
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
...

Aacini
Expert
Posts: 1670
Joined: 06 Dec 2011 22:15
Location: México City, México

Re: TextToHtml.bat - Easily create World Wide Web pages!

#29 Post by Aacini » 28 Mar 2014 14:57

aGerman wrote:UTF-8 could be the default charset depending on the text editor you used.

As soon as the Batch code is UTF-8 encoded the HTML is full of these error messages.

Code: Select all

...
<body>
<h1>test</h1>
"¿"" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
...

I am afraid I don't understand... How a text file copy-pasted from this forum or the original site can be created as UTF-8 encoded file? This problem would appeared many time ago and with many other Batch files listed as text or, in that case, with any Batch file created with the standard text editor that many users of this forum use!

Please, please, could you confirm if the TextToHtml.bat conversion program works correctly when it is not encoded as UTF-8 file? THANKS!

Antonio

aGerman
Expert
Posts: 3971
Joined: 22 Jan 2010 18:01
Location: Germany

Re: TextToHtml.bat - Easily create World Wide Web pages!

#30 Post by aGerman » 28 Mar 2014 15:15

Antonio

As far as I tested your Batch code works properly. Of course both the text file and the Batch code have to be encoded as ANSI or ASCII file.
As I already wrote UTF-8 could be the default setting for a certain text editor. Also it could happen that the encoding of text files were automatically changed during upload or download (depending on the target operating system of the server or even the client).

Regards
aGerman

Post Reply