Project Description Create a C++ application that converts a text file into a format more appropriate for use in a webpa
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Project Description Create a C++ application that converts a text file into a format more appropriate for use in a webpa
The executable file must be named: txt2html.exe The program will operate as a command-line utility (not a console input program). An Example: c:> txt2html Story.txt Story.html This example uses <br> line-break tags. Below is an ASCII text file named "Story.txt" converted to "Story.html". Note that represents an <Enter> in the text. Story.txt Are These Aliens Martians? اله an adaptation J The men from Earth stared at the aliens. The little green men had pointed heads and orange toes with one long curly hair on each tee. - اله 2. G. Wells' novel The War of the Worlds (1898) has had an extraordinary influence on science fiction. - Wells' Martians are a technologically advanced species. with an ancient civilization. They somewhat resemble cephalopods, with large, bulky brown bodies and sixteen snake-like tentacles, in two groups of eight, around a quivering V-shaped mouth; they move around in 100 feet tall tripod fighting-machines they assemble upon landing, killing everything in their peth. Story.html <!DOCTYPE html> <html> <head> <title>Story</title> </head> <body> Are These Aliens Martians? <br> <br> <br> an adaptation <br> <br> The men from Earth stared at the aliens. The little green men had pointed heads and orange toes with one long curly hair on each toe. <br> <br> H. G. Wells' novel The War of the Worlds (1898) has had an extraordinary influence on science fiction. Welis' Martians are a technologically advanced species with an ancient civilization. They somewhat resemble cephalopods, with large, bulky brown bodies and sixteen snake-like tentacles, in two groups of eight, around a quivering V-shaped mouth; they move around in 100 feet tall tripod fighting-machines they assemble upon landing, killing everything in their path. <br> <br> <br> <br> by your name <br> <br> </body> </html> by your name Another Example: c:\> txt2html -p Story.txt Story.html This example uses <p> paragraph tags. Below is an ASCII text file named "Story.txt" converted to "Story.html". Note that represents an <Enter> in the text. Story.txt Are These Aliens Martians? an adaptation The men from Earth stered at the aliens. The little green men had pointed heads and orange toes with one long curly hair on each toe. Story.html <!DOCTYPE html> <html> <head> <title>Story</title> </head> <body> <p> Are These Aliens Martians? </p> <br> <p> an adaptation </p> <p> The men from Earth stared at the aliens. The little green men had pointed heads and orange toes with one long curly hair on each toe. H. G. Wells' novel The War of the Worlds (1898) has had an extraordinary influence on science fiction. - Wells' Martians are a technologically advanced species with an ancient civilization. They somewhat resemble cephalopods, with large, bulky brown bodies and sixteen snake-like tentacles, in two groups of eight,
</p> around a quivering V-shaped mouth; they move around in 100 feet tall tripod fighting-machines they assemble upon landing, killing everything in their path. by your name <p> H. G. Wells' novel The War of the Worlds (1898) has had an extraordinary influence on science fiction. Wells' Martians are a technologically advanced species with an ancient civilization. They somewhat resemble cephalopads, with large, bulky brown bodies and sixteen snake-like tentacles, in two groups of eight, around a quivering V-shaped mouth; they move around in 100 feet tall tripod fighting-machines they assemble upon landing, killing everything in their path. </p> <br> <br> <p> by your name </p> </body> </html> -r Program Interface txt2html [--help] [-rp] textfilename [htmlfilename] --help display the help text for the program. report conversion metrics use <p> tag for paragraph breaks text Filename the name of the ASCII text file to process htmlFilename the name of the HTML file receiving the output. If not provided the text filename will be used with its extension changed to ".html" -p Notes 1. If the help switch is found all other command line arguments are ignored. 2. The 'r' and 'p' switches can be used individually, or together, and in any order. 3. The 'r' switch will report: # lines input # paragraphs output 4. The text filename must be present and can have any file extension (not just .txt). 5. The html filename is optional. If present, it can have any file extension (not just.html). If absent, it will have the same stem as the text filename, but the extension.html. It is an error if both files have the same name. 6. Do not hardcode or limit the filenames in any way! Do not require txt or .html extensions on the name. Do not limit, change, or prevent a path prefix to either filename. Command-line Examples txt2html Story.txt txt2html -p Story.txt txt2html -r \usr\Story.txt txt2html -pr Story.txt txt2html -rp Story.txt txt2html Story.txt Story.html txt2html -p Story.txt \usr\NewStory.html txt2html -r Story.txt Other.txt