enipla
June 16, 2011, 3:56pm
1
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?
friedo
June 16, 2011, 4:46pm
2
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.
enipla
June 16, 2011, 4:56pm
3
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.
BigT
June 16, 2011, 8:11pm
4
Use the <pre> tag in the HTML. I believe that will stop word wrapping in the txt version.