Here is my problem. Please forgive the length of the explanation, and feel free to ask questions if anything needs to be clarified.
I import long strings of text into Excel. I use a spreadsheet with HTML tags interspersed throughout it to serve as a sort of template. The long text strings are embedded in between the HTML tags. The only format in which I can save the file that is eventually converted to HTML is the .prn format. All the other plain-text formats Excel has use tabs, quotation marks or other foreign characters that would screw up the HTML coding. Once I have my .prn file I use a small custom-written applet to strip out the extra spaces in the .prn file, and then save the output as an HTML file.
This system has worked well for me, but one of the limitations I face with using .prn is that it cuts off the long text strings and appends the remainder of these strings at the bottom of the file. These remainder strings are cut off when the final HMTL file is generated. What I have to do is manually reinsert the strings of text that were originally truncated into the HTML files.
I had experimented with developing complex formulas in Excel that would divide a long string of text into separate lines. It would even make the breaks in between whole words so that a word wouldn’t be cut off in the middle. Usually, however, I would get errors and I could not figure out what caused them when all I was doing was having the next line start at a certain point in the text string following the occurrence of a space, which marked where the next whole word would start.
I gave up on this after much trial and error and decided to just break the text into strings of the same length, regardless of where the next word began. This introduces the problem of having words split in the middle. If it could be done in HTML, I would like be able to join several strings together and have them appear as a single body of text, but as far as I know there is no way this can be done in HTML.
Here is a simplified example to help illustrate my problem.
Let’s say the text string is the Pledge of Allegiance. (the actual text strings can be much longer than this, but remember this is simplified for the example). I want to divide the text string into 40-character segments, which I know how to do in Excel. The lines would appear as follows:
I Pledge Allegiance to the flag of the U
nited States of America and to the Repub
lic for which it stands, one Nation unde
r God, indivisible, with liberty and jus
tice for all.
What I want to know is, is there a way in HTML that I could string each of these segments together so that they would appear as one contigious string? The ways I have tried it put spaces where the line breaks occur.