0
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main()
{
 string linea;
 ifstream fileIn("input.txt"); 
 ofstream fileOut("output.html",ios::out);

 //working with the input text
 if (!fileIn)

  cout<<"\nERROR: Unable to read the file!\n";

 else
 {
  //working with the output text
  if (fileOut.is_open())
  {
   fileOut << "<html xmlns=\"http://www.w3.org/1999/xhtml";
   fileOut << "\" xml:lang=\"en\">" << endl;
   fileOut << "<head>" << endl;
   fileOut << "<meta http-equiv=\"Content-Type\"content=";
   fileOut << "\"text/html; charset=UTF-8\" />" << endl;
   fileOut << "<title>" <<"The Republic, by Plato" <<"</title>" << endl;
   fileOut << "</head>" << endl;
   fileOut << "<body>" << endl;

   while (! fileIn.eof() )//lectura de lineas del archivo
   {
    getline (fileIn, linea);
    fileOut << linea <<"<br />" <<endl;

   }//end while

   fileOut << "</body>";
   fileOut << "</html>";
   
   fileIn.close();
   fileOut.close();

  }//end if

 }//end else
}

I would like to get so that the source code instead of looking like <br /> at the end of every line. so that it will only put an </br> at the end with out a space

Edited by WolfPack: Added [CODE=c++][/CODE] Tags

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by WolfPack
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.