javascript .txt file question

This code -

addListWindow.document.body.innerHTML = “6504713|AAAAAAAAAA, BBBBBBBBBBB|1234 S GOLDEN EAGLE AVE|HIGHLANDS RANCH CO 801290000”;

writes the text into a new browser. Works fine.

But, when I save the browser window to a .txt file, a carriage return is inserted between the ‘CO’ and ‘801290000’ :mad:

If I shorten the string, it works fine. I’m building delimited text files for address lists. I can’t have random carriage returns in it.

Is this some default setting of text files?

You can’t use a browser to build delimited text files; it’s going to insert carriage returns and munge character encodings wherever it feels appropriate to do so.

Odd though. It looks fine in the browser window. If I cut and paste from the browser to the .txt file it works fine.

Something about the ‘Save As’ is when it is inserting carriage returns.

Use the <pre> tag in the HTML. I believe that will stop word wrapping in the txt version.