Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Rob Gaddi Newsgroups: comp.lang.python Subject: Re: How can I export data from a website and write the contents to a text file? Date: Wed, 18 Nov 2015 18:05:33 -0000 (UTC) Organization: A noiseless patient Spider Lines: 22 Message-ID: References: <9365cf2f-e9c7-4338-83b4-ce3d1d7ce1d6@googlegroups.com> <6e0f470b-f896-43ae-8f83-b20f22a9db8d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 18 Nov 2015 18:05:33 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e1519d2450e35d4c7974a956276402c0"; logging-data="11642"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+HfpC+xI1VW8hTcoWVjH2E" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:EShJ+o5j82GJe0tJrgqZE5O5TwY= Xref: csiph.com comp.lang.python:98991 On Wed, 18 Nov 2015 09:40:58 -0800, ryguy7272 wrote: > > It doesn't seem like the '\n' is doing anything useful. All the text is > jumbled together. When I open the file in Excel, or Notepad++, it is > easy to read. However, when I open it in as a regular text file, > everything is jumbled together. Is there an easy way to fix this? You're suffering cause-effect inversion. Windows default Notepad is a fundamentally crippled text editor that only knows how to handle Windows/ DOS style text files, where the line endings is '\n\r'. Notepad++, along with many other excellent editors available for Windows, is smart enough to figure out from the file whether it's Windows style or UNIX style, where line endings are just a bare '\n'. So the problem wasn't with what you were writing, it's with how you define "open it as a regular text file". On my Windows machine I long ago switched the default editor to Notepad++ for everything and was far happier for it. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix.